I’m having some trouble with Hugo’s new nested sections. I want to specify a custom layout for nested section list pages according to their parent sections, but I’m not sure where to put the layout file so that it gets used.
Let’s say I have two main sections on my site:
post is a flat section, but in
book I want a mix of direct items and subsections. The hierarchy looks like this:
content ├── _index.md ├── book │ └── shortbook.md │ └── book1 │ | ├── _index.md │ | ├── chapter1.md │ | ├── chapter2.md │ | └── chapter3.md │ └── book2 │ ├── _index.md │ ├── chapter1.md │ ├── chapter2.md │ └── chapter3.md └── post ├── _index.md ├── something.md ├── another.md └── thing.md
I want to specify a custom layout for the
/book/SECTION/ (or at least for
/book/book1/) list page.
As per this, I’ve tried placing a file at:
I’ve also tried:
The last one achieves the desired effect, but has the obvious undesired side effect of changing the default list template site-wide. All the others just cause the
/book/book1/ page to be rendered with the
With this being such a new feature, is what I’m trying to do possible?