Is subsections (nested sections) support available in Hugo?

I’ve looked around in the docs, can’t find the answer. Does Hugo support subsection (nested section)? I have the following architecture:

├── part-A
│  ├── page01.md
│  ├── page03.md
│  ├── subsection-A/
│  │   ├──index.md
│  │   ├──something-here.md
│  ├── subsection-B/
│  │   ├──index.md
│  │   ├──something-here.md
│  ├── page04.md
│  ├── page0n.md

Is there a way to generate a list view for such architecture? How about support for ordering the content above for pagination?

Thank you,
-Z

I’m wondering the same thing. Do subsections get their own lists as well?

No, but it is coming soon.

Super! After more digging, I saw your WIP on Github. This will be really great. Thanks for your work!

When is soon? Is it on the roadmap somewhere? Is it doable somehow as of today?

Please link me to the WIP or any other hacks so far…

You can manually create link lists for subfolders in index.md. Hugo does not yet support the automatic generation of a list of links for subfolders.

hello, is this feature now available in hugo 0.20.7? or is it on the roadmap for 0.21? i remember either @spf13 or someone else mentioning this on github earlier…

Here is the commit by @bep that will enable Nested Sections in Hugo 0.21 (due on May the 29th)

https://github.com/bep/hugo/commit/6d5da896eb13ff34504e6e2698822ad77cff1326

How very cool! I am about to start developing a product site and I am really thankful for this new feature!

That is in for Hugo 0.22.

Ok. Sorry. I thought it was 0.21 after reading your comment over here: https://github.com/spf13/hugo/issues/455#issuecomment-284180004

It was, but I have been busy with other things … and I have go get the “multi shortcode feature” out in the open; so I will be releasing Hugo 0.21 in about a week – then I think we will do a short 0.22 release with mostly the nested sections.

3 Likes