Here is what I roughly did so far:
add the files from Photoswipe plus initphotoswipe.js into static/plugins/photoswipe
init Photoswipe in the layouts/partials/footer.html
add custom.css public/css that is used by the shortcode below
create the layouts/shortcodes/gallery.html shortcode that the “post” will use
create sample post in content/post/index.md that uses the gallery
I run it with:
git clone --recurse-submodules https://github.com/kenwphoto/hugo-photoswipe-test.git
Any hints to get it working are appreciated.
@jmooring you are right, when replacing the shortcut with contents from the initial blog post it does work for me as well. Thank you!
Thanks for sharing the code, you have a PR waiting for you to approve
I am not always able to debug the implementations people make of this shortcode, this was an exception. And thank you for posting on the forum, I get emails once in a while and this way people can find help by themselves.
@brunoamaral this is it. The div in the gallery shortcode was closed too early. I was stripping down class attributes from that div by commenting the original and create a new line but I overlooked that my text editor put in a closing tag automatically.
Thank you for the PR! I appreciate it. There’s one aspect I don’t quite understand yet: Why do you move the PhotoSwipe initialization from layouts/partials/site-footer.html to layouts/_default/baseof.html as well?
You can use the get resources on a seperate page to add all the images and then on home page use the .Site.GetPage "the-page-you-created" and simply use the photoswipe partial weird way I know I tried this using the shortcode of @brunoamaral yesterday and it works for me