liwenyip / hugo-easy-gallery

Automagical css image gallery in Hugo using shortcodes, with optional lightbox/carousel gadget using PhotoSwipe and jQuery.
MIT License
573 stars 111 forks source link

Fix image 404 on sites with paths in URL #55

Closed mgibson323 closed 2 years ago

mgibson323 commented 4 years ago

I am using Hugo Easy Gallery on a site I am working on. Whenever I push changes to the site a Jenkins build is kicked off to create a staging site. The URL for the staging site contains a path in it using the name of the branch, i.e.:

http://someurl.com/somebranch/

This causes the images in the overlay to 404, while the thumbnail images display fine.

The change I am proposing here seems to fix this issue, as my latest build works and the images in the overlay are no longer causing a 404.

kishorbhat commented 2 years ago

Thematically similar to #47, LGTM. Thanks for the PR!