My site uses .PrevInSection and .NextInSection to create links from one page to the next. What I’d like to do is go ‘next’ from the last page and wrap-around to the first, and vice-versa.
If I could find a way to access the first page (in the current sort order), which I’ll call .FirstInSection, I could do something like:
{{ with .NextInSection }}
<a href="{{ .Permalink }}">{{ .Title }} ❮</a>
{{ else }}
{{/* This doesn't work, because there's no such thing as '.FirstInSection' (yet) */}}
<a href="{{ .FirstInSection }}">{{ .FirstInSection.Title }} ❮</a>
{{ end }}
Alternatively, I could add a wrap parameter to .PrevInSection and .NextInSection.
Is there already a way to do this, or shall I invent one?