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

Multiple galleries on one page #70

Closed neilcharles closed 9 months ago

neilcharles commented 9 months ago

The galleries are beautiful but I'm having an issue when I try to add two of them on the same page.

I'm using page bundles and have installed hugo-shortcode-gallery via git in my themes folder. I'm loading jquery with galleryLoadJQuery = true in hugo.toml. My content is structured like this:

I have two lines in index.md {{< gallery match="gallery1/*" sortOrder="desc" rowHeight="150" margins="5" thumbnailResizeOptions="600x600 q90 Lanczos" showExif=true previewType="blur" embedPreview=true >}}

{{< gallery match="gallery2/*" sortOrder="desc" rowHeight="150" margins="5" thumbnailResizeOptions="600x600 q90 Lanczos" showExif=true previewType="blur" embedPreview=true >}}

Either line works fine on its own but when they're both present, the second gallery doesn't display and its pictures appear in the first gallery (but not the thumbnails, only when you page through the lightbox).

Adding the second line also causes an error in the console: Uncaught Error: jQuery is not loaded, hugo-shortcode-gallery wont work without it!

neilcharles commented 9 months ago

Quick update to say it looks like the latest commit caused this problem. I noticed the jQuery error I was seeing was introduced in the latest update and 8fbc102 works fine. Thanks for the theme! I've rolled back for the moment and it's working perfectly :)

dholbach commented 9 months ago

I'm seeing the same issue.

mfg92 commented 9 months ago

Thank you for reporting the bug and identifying the problematic commit. The issue has been resolved with the latest release v1.1.1.