Loop through .Data.Pages inside single.html

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.

1 Like

Many thanks @bjornerik!
Worked a charm with an additional comparison against the .Section var.