Hello. I’m trying to create gallery/single lightbox using the official Hugo documentation and small JS gallery script from CDN. It seems like I’m having some trouble.
Works like a charm. But I want to generate thumbnail because I won’t use CSS rules for minimize thumbnail image. I’m looking to that article: Thumbnail Images on your Hugo Blog Posts · Make with Hugo and try to integrate that code into existing img2.html like that:
I don’t want to know the published path. I want to know the source path. Is it in the static directory, the assets directory, something else that’s mounted?
{{ range .Resources.Match "gallery/**" }}
<a class="spotlight gallery-thumbnail" href="{{ .RelPermalink }}">
{{ with .Fill "200x200 q100 Center" }}
<img class="spotlight" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
</a>
{{ end }}
Try it:
git clone --single-branch -b hugo-forum-topic-50494 https://github.com/jmooring/hugo-testing hugo-forum-topic-50494
cd hugo-forum-topic-50494
hugo server
Sorry, I don’t understand the question. By placing the images within a page bundle as shown in the content structure above, we don’t need to use front matter to build a gallery.