Lightbox Image Gallery

Having added exif to individual images I was in pursuit of a way to create image galleries and was able to directly use the code from this page which is a shortcode that creates thumbnails and a lightbox gallery of all images in the directory. A caption is extracted from the image but the exif data is not so I adapted it slightly as below and add the caption text to the caption field in Lightroom (not the title field).

<a href="{{ .Permalink }}" data-lightbox="x"><img src="{{ $resized.Permalink }}" /></a>

Becomes

<a href="{{ .Permalink }}" data-lightbox="x" data-title="<div class='exifTags-lightbox'> {{ with .Exif }} {{ .Tags.ImageDescription }} </br> <i class='far fa-calendar'></i>   {{ with .Date }} {{ .Format "Mon, 02 Jan 2006, 15:04" }} &nbsp; <i class='fas fa-camera'></i> {{ end}} {{ .Tags.Model }}, f={{ .Tags.FocalLength }} mm, {{ .Tags.ExposureTime }} s, f/{{ .Tags.FNumber }}, ISO{{ .Tags.ISOSpeedRatings }} {{ end }} </div>"><img src="{{ $resized.Permalink }}" /></a>

Previous Post Next Post