Trying to list the top-level sections and their pages:
<ul>
{{ range .Site.Sections }}
<li>
<a href="{{ .RelPermalink }}">{{ .Name }}</a>
<ul>
{{ range where .Site.RegularPages "Section" .Name }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
Content structure:
content/
- section1/
- page1/
index.md
- page2/
index.md
_index.md
- section2/
- page1/
index.md
- page2/
index.md
_index.md
… And I only get the two section names, without the pages under them.