mfg92 / hugo-shortcode-gallery

A theme component with a gallery shortcode for the static site generator hugo.
MIT License
360 stars 66 forks source link

Is there a way to limit the number of images loaded? #85

Closed rpapallas closed 3 months ago

rpapallas commented 3 months ago

If a gallery contains numerous images, is there an option to limit the number of images that appear on page load? I am thikning of onPageLoadLimit="10". It would be great to have this option to help pages load faster and have a button “load all” underneath to load all of them should the visitor want to see the entire gallery.

If that's of interest, I could look into implementing it at some point.

mfg92 commented 3 months ago

If previewType is set to "blur" (or "color"), a very low resolution image (or a single pixel image) will be loaded for every image in the gallery first. The hight resolution thumbnail images (see thumbnailResizeOptions) will only be loaded if they are on the currently visible part of the page (or close to it). This leads to a faster loading page. You can set previewType to "none" to disable this feature and all thumbnails will be directly loaded. [README]

Is this what you need?

rpapallas commented 3 months ago

That seems to take care of my concern, yes! Thank you.