Skip to content

Commit 503bcf0

Browse files
committedMay 5, 2015
Merge pull request #1687 from getnikola/islink
fix .islink
2 parents 8c2c32b + 05593dd commit 503bcf0

File tree

7 files changed

+32
-25
lines changed

7 files changed

+32
-25
lines changed
 

‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Features
3333
Bugfixes
3434
--------
3535

36+
* Make ``.islink`` work properly (via Issue #1536)
3637
* RSS_LINKS_APPEND_QUERY not working in RSS feeds for tags
3738
* `nikola check -l` didn’t scan posts
3839
* Don’t use sets for ``FAVICONS`` (Issue #1674)

‎docs/manual.txt

+21-15
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ to your configuration::
538538

539539
That template needs to either be part of the theme, or be placed in a ``templates/``
540540
folder inside your site.
541-
541+
542542
enclosure
543543
Add an enclosure to this post when it's used in RSS. See `more information about enclosures <http://en.wikipedia.org/wiki/RSS_enclosure>`__
544544

@@ -1240,14 +1240,16 @@ Annotations require JQuery and are therefore not supported in the base theme.
12401240
You can check bootstrap theme's ``base.html`` for details on how to handle them in
12411241
custom themes.
12421242

1243-
Image Galleries
1244-
---------------
1243+
Images and Galleries
1244+
--------------------
12451245

12461246
To create an image gallery, all you have to do is add a folder inside ``galleries``,
12471247
and put images there. Nikola will take care of creating thumbnails, index page, etc.
12481248

1249-
If you click on images on a gallery, you should see a bigger image, thanks to
1250-
the excellent `colorbox <http://www.jacklmoore.com/colorbox>`_
1249+
If you click on images on a gallery, or on images with links in post, you will
1250+
see a bigger image, thanks to the excellent `colorbox
1251+
<http://www.jacklmoore.com/colorbox>`_. If don’t want this behavior, add an
1252+
``.islink`` class to your image or link.
12511253

12521254
The gallery pages are generated using the ``gallery.tmpl`` template, and you can
12531255
customize it there (you could switch to another lightbox instead of colorbox, change
@@ -1267,20 +1269,24 @@ The ``conf.py`` options affecting images and gallery pages are these::
12671269
# "OUTPUT_PATH/relative_destination/gallery_name"
12681270
# Default is:
12691271
GALLERY_FOLDERS = {"galleries": "galleries"}
1270-
# One or more folders containing images. The format is again a dictionary of
1271-
# {"source": "relative_destination"}. Images will be scaled down if necessary so
1272-
# that neither width nor height is greater than MAX_IMAGE_SIZE and copied to
1273-
# destination folder. A thumbnail will also be created in the same folder with
1274-
# ``.thumbnail`` inserted in the file name before the file extension
1275-
# (e.g. ``tesla.thumbnail.jpg``).
1276-
IMAGE_FOLDERS = {'images': 'images'}
1277-
# More image/gallery options:
1272+
# More gallery options:
12781273
THUMBNAIL_SIZE = 180
1279-
IMAGE_THUMBNAIL_SIZE = 400
12801274
MAX_IMAGE_SIZE = 1280
12811275
USE_FILENAME_AS_TITLE = True
12821276
EXTRA_IMAGE_EXTENSIONS = []
12831277

1278+
# If set to False, it will sort by filename instead. Defaults to True
1279+
GALLERY_SORT_BY_DATE = True
1280+
1281+
# Folders containing images to be used in normal posts or pages. Images will be
1282+
# scaled down according to IMAGE_THUMBNAIL_SIZE and MAX_IMAGE_SIZE options, but
1283+
# will have to be referenced manually to be visible on the site
1284+
# (the thumbnail has ``.thumbnail`` added before the file extension).
1285+
# The format is a dictionary of {source: relative destination}.
1286+
1287+
IMAGE_FOLDERS = {'images': 'images'}
1288+
IMAGE_THUMBNAIL_SIZE = 400
1289+
12841290
If you add a file in ``galleries/gallery_name/index.txt`` its contents will be
12851291
converted to HTML and inserted above the images in the gallery page. The
12861292
format is the same as for posts.
@@ -1647,7 +1653,7 @@ and it will produce:
16471653
Post List
16481654
~~~~~~~~~
16491655

1650-
.. WARNING::
1656+
.. WARNING::
16511657

16521658
Any post or page that uses this directive will **never** be considered up-to-date,
16531659
meaning that every time you build the site, that post/page and everything that

‎nikola/conf.py.in

+6-6
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,12 @@ REDIRECTIONS = ${REDIRECTIONS}
430430
# If set to False, it will sort by filename instead. Defaults to True
431431
# GALLERY_SORT_BY_DATE = True
432432
#
433-
# Folders containing images to be used in normal posts or
434-
# pages. Images will be scaled down according to IMAGE_THUMBNAIL_SIZE
435-
# and MAX_IMAGE_SIZE options, but will have to be referenced manually
436-
# to be visible on the site. The format is a dictionary of {source:
437-
# relative destination}.
438-
#
433+
# Folders containing images to be used in normal posts or pages. Images will be
434+
# scaled down according to IMAGE_THUMBNAIL_SIZE and MAX_IMAGE_SIZE options, but
435+
# will have to be referenced manually to be visible on the site
436+
# (the thumbnail has ``.thumbnail`` added before the file extension).
437+
# The format is a dictionary of {source: relative destination}.
438+
439439
IMAGE_FOLDERS = {'images': 'images'}
440440
# IMAGE_THUMBNAIL_SIZE = 400
441441

‎nikola/data/themes/bootstrap-jinja/templates/base.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
{{ template_hooks['page_footer']() }}
7575
</div>
7676
{{ base.late_load_js() }}
77-
<script>$('a.image-reference:not(.islink)').colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
77+
<script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
7878
<!-- fancy dates -->
7979
<script>
8080
moment.locale("{{ momentjs_locales[lang] }}");

‎nikola/data/themes/bootstrap/templates/base.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ ${template_hooks['extra_head']()}
7474
${template_hooks['page_footer']()}
7575
</div>
7676
${base.late_load_js()}
77-
<script>$('a.image-reference:not(.islink)').colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
77+
<script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
7878
<!-- fancy dates -->
7979
<script>
8080
moment.locale("${momentjs_locales[lang]}");

‎nikola/data/themes/bootstrap3-jinja/templates/base.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</div>
7676

7777
{{ base.late_load_js() }}
78-
<script>$('a.image-reference:not(.islink)').colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
78+
<script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
7979
<!-- fancy dates -->
8080
<script>
8181
moment.locale("{{ momentjs_locales[lang] }}");

‎nikola/data/themes/bootstrap3/templates/base.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ ${template_hooks['extra_head']()}
7575
</div>
7676

7777
${base.late_load_js()}
78-
<script>$('a.image-reference:not(.islink)').colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
78+
<script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
7979
<!-- fancy dates -->
8080
<script>
8181
moment.locale("${momentjs_locales[lang]}");

0 commit comments

Comments
 (0)
Please sign in to comment.