Is there anyway to loop over the pages in a section on single.html? I want to achieve a simple sidebar on all post pages.
{{ range first 10 .Data.Pages }}
<li>{{ .Title }}</li>
{{ end }}
Is there anyway to loop over the pages in a section on single.html? I want to achieve a simple sidebar on all post pages.
{{ range first 10 .Data.Pages }}
<li>{{ .Title }}</li>
{{ end }}
Something ala $.Site.Pages should do it.
As documented in http://gohugo.io/templates/variables/
It now even has a search engine.
Many thanks @bjornerik!
Worked a charm with an additional comparison against the .Section
var.