mfg92/hugo-shortcode-gallery

Is it possible to apply filters to all images?

Closed this issue · 1 comments

Thank you for providing this great shortcode!

resizeOptions allows me to control the size of the thumbnails. Is there a way to do the same for the images being displayed in the swipebox itself.

Some of my photos are many MB large (and I want to provide them for download too). Is there a way to serve lower-res/lower quality versions in the gallery without resizing them myself? I'm not sure how to achieve this since it appears that the images are being loaded dynamically by the jQuery plugin.

mfg92 commented

Hi,

this is currently not possible. But you can change the code yourself. In this line https://github.com/mfg92/hugo-shortcode-gallery/blob/master/layouts/shortcodes/gallery.html#L132 the link to the image that will be displayed in swipebox is assigned. You can change that to something like this (not tested):

{{ $full := ($original.Fit ("4000x4000 q85")) }}
<a href="{{ $full.RelPermalink }}"

For more information have a look at:
https://gohugo.io/content-management/image-processing/#fit

Btw.: A pull request that adds this in a configurable manner would be nice.