Range pages inside subsections

Hi there.

On this one site i have 3 layers of content. Listing Pages wthat only go a second layer works fine. However, if i have a nested branch bundle my range doesnt show the _index for that section.
This is my content architecture right now.

content/
├── _index.md
├── overview
│   ├── _index.md
│   ├── reach
│   │   ├── index.md
│   │   ├── image1.jpg
│   └── media
│       └── index.md
└── impact
    ├── _index.md
    └── actions
        ├── _index.md
        ├── action1
        │  └── index.md
        └── action2
            └── index.md

So, when navigating to overview, the following code works:

{{ range $.Pages }}
  <li>
    <a class="..." href="{{ .RelPermalink | relLangURL }}">{{ .Title }}</a>
  </li>
{{ end }}

But it doesnt work under impact (it will not list action’s _index.md). .RegularPages will only show 3rd level pages, also not the 2nd level branch.
For now im just using a custom layout with the link hardcoded…

Any ideas?
cheers

This may help: _index.md in nested sections

(The part about ranging .Sections)

Thank you @zwbetz that did the trick!
Maybe further on il try to automate this instead of calling a different layout but it is much better than hardcoding the link (if only for consistency)

1 Like