From: Vladimír Vondruš Date: Fri, 29 Mar 2019 10:14:50 +0000 (+0100) Subject: m.images: make it possible to provide custom titles for image grid. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=e9d9dd972deb1014d00164aaade2f2c6ee4bb4d1;p=blog.git m.images: make it possible to provide custom titles for image grid. --- diff --git a/doc/plugins/images.rst b/doc/plugins/images.rst index b5900d98..3c5e021a 100644 --- a/doc/plugins/images.rst +++ b/doc/plugins/images.rst @@ -130,10 +130,13 @@ option for both images and figures. Use the :rst:`.. image-grid::` directive for creating `image grid <{filename}/css/components.rst#image-grid>`_. Directive contents are a list of image URLs, blank lines separate grid rows. The plugin -automatically extracts size information and scales the images accordingly. If -the image has EXIF information, properties such as aperture, shutter speed and -ISO are extracted and displayed in the caption on hover. The images are also -made clickable, the target is the image file itself. +automatically extracts size information and scales the images accordingly. The images are made clickable, the target is the image file itself. + +If the image has EXIF information, properties such as aperture, shutter speed +and ISO are extracted and displayed in the caption on hover. It's also possible +to provide a custom title --- everything after the filename will be taken as +a title. If you use ``..`` as a title (a reST comment), it will disable EXIF +extraction and no title will be shown. Example of a two-row image grid is below. Sorry for reusing the same two images all over (I'm making it easier for myself); if you want to see a live example @@ -146,16 +149,16 @@ with non-repeating images, head over to `my blog
A Ship
-

Image grid:

+

Image grid, second row with a custom title and no title:

@@ -82,11 +82,12 @@ Yes.
-
F2.8, 1/1600 s, ISO 100
+
A custom title
-
F9.0, 1/250 s, ISO 100
+
+
diff --git a/pelican-plugins/m/test/images/page.rst b/pelican-plugins/m/test/images/page.rst index 1aea1188..98303145 100644 --- a/pelican-plugins/m/test/images/page.rst +++ b/pelican-plugins/m/test/images/page.rst @@ -81,15 +81,15 @@ Figure with a height: A Ship -Image grid: +Image grid, second row with a custom title and no title: .. image-grid:: {static}/ship.jpg {static}/flowers.jpg - {static}/flowers.jpg - {static}/ship.jpg + {static}/flowers.jpg A custom title + {static}/ship.jpg .. Image grid with a PNG file, JPEG with sparse EXIF data, JPEG with no EXIF data and long exposure (>1 second):