Hi there!
I am struggling to make the following work (paraphrased from my /layouts/news/single.html template):
<article>
{{ .Content }}
{{ if .NextInSection }}
<a href="{{ .NextInSection.RelPermalink }}" class="action-button">Next</a>
{{ else }}
<a href="{{ .FirstInSection.RelPermalink }}" class="action-button">First</a>
{{end}}
</article>
Issue 1:
{{ if .NextInSection }} never evaluates to true; it renders as .
On compile, I get the following error:
Error while rendering page news\201610-new-website-launched.md: template: theme/news/single.html:34:20: executing "theme/news/single.html" at <.NextInSection.Perma...>: can't evaluate field Permalink in type *hugolib.Page
Issue 2:
It doesn’t seem that there is indeed a function such as .FirstInSection, so I am trying to figure out how to simulate the same functionality.
Can someone help?