Hi, given the following page structure, how can I get hugo to use the same layout for all index.md
pages?
demo/
├── about
│ ├── index.md
│ └── team
│ └── index.md
├── blog
│ ├── post-1.md
│ └── post-2.md
└── index.md
i.e. only the blog section should use the layouts/_default/list.html
and layouts/_default/single.html
layouts but the index.md
pages should all use the same “index layout”.
I tried with adding a template file layouts/_default/indexpage.html"
and defining layout = "indexpage"
in the front matter of the index.md files (following https://gohugo.io/templates/lookup-order/#examples-layout-lookup-for-regular-pages - Single page in "posts" section with layout set
), but that doesn’t seem to work as intended: /
and about/
and about/team/
sometimes show the right layout and content, but sometimes also show no content at all, because hugo seems to use the list template (and there’s nothing to list).
Am I missing something? What would be the right (idiomatic) approach?
Thanks
hugo v0.75.1 extended on macOS