Hugo+Ananke+PhotoSwipe

Ah, I didn’t know content sections are different. That explains why there’s nothing for the gallery-shortcode to iterate over. I’m learning a lot here - thx!

Interesting, thanks! I didn’t get it to work yet, but I’ll keep trying. I’d also need to hide that page the resources are pulled from to prevent the gallery from showing up twice.

I was thinking (since a given hugo site has just a single frontpage) to use a Site Variable to specify where to find the images in this particular case. For example, specify gallery_folder = 'gallery' in the params section of the config.toml, and use that in the layouts/index.html partial/override but I haven’t figured out how/if it’s possible to access the *jpg files. They aren’t part of any page resource, so maybe this approach is not viable.

https://gohugo.io/content-management/page-bundles/#headless-bundle

2 Likes

Thanks everyone!

Here’s an initial attempt to display the gallery on the front page (not in main yet but in a branch named gallery-on-frontpage).

@brunoamaral quick question, when placing the images in a different directory, for example content/images (instead of content/gallery), I’ve noticed that I also need to change the front matter from:
name: gallery-:counter
to
name: images-:counter

But I can’t seem to find where name is being used.
Here’ an example.

It’s for the figcaption but I forgot to place it there, you’ll notice that tag is empty.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.