How to generate a list of all pages nested in sections?

I am still trying to wrap my head around the way menus work in Hugo, can somebody lend a helping hand?

I have the pages organised in subdirectories much like the example in Hugo docs

    │   │
    │   ├───warm
    │   │   ├───orange
    │   │   ├───red
    │   │   └───yellow
    │   │
    │   └───cool
    │       ├───blue
    │       ├───green
    │       └───purple

and I want to render this hierarchy as is in a sidebar.
I tried to use various .Data.Pages.* methods mentioned in docs but they won’t render anything, I tried to put some random text in the loop but it wouldn’t print the text either.
Can anyone give me any pointer?

Can you show me the templating you’re using that isn’t working?

Also, Hugo doesn’t currently support nested sections–but it’s on the roadmap :smile:!–so assuming that colour is actually content/colour, then everything underneath is part of the same section. You can use where; e.g.

{{range where .Site.Pages ".Section" "colour"}}
Your code here
{{ end }}

But if you want to nest things, you might have to work around the current lack of nested sections by declaring a specific type in the front matter of content files in the subdirectories…