Hello,
I’m iterating through collection of resources and I somehow need to get next and previous resource in the slice. Is there any way to achieve that? I know that there are NextInSection and PrevInSection for section pages, but I know of no analogy for page resources.
<ul>
{{ range .Resources.Match "images/*.jpeg" }}
<li id="{{ .Title }}">
<a href="#{{/* Title of the previous resource */}}">Previous</a>
{{ .Title }}
<a href="#{{/* Title of the next resource */}}">Next</a>
</li>
{{ end }}
</ul>
This works perfectly, thanks! I could figure this out, but since I’m totally new to Hugo (and Go), I was not exactly sure about the syntax or whether there is some more expressive way to achieve this.