You can use both variants in your project but you need to understand the implications which come with them. Since Hugo 0.32 everything in /content
is basically regarded as page bundle and with that the distinction between index.md
and _index.md
got way more important. Refer to the documentation posted above to learn more.
Basically with an _index.md
hugo basically performs like in earlier versions so every file gets their own structure. If you name it as index.md
however it changes the behavior. The index-file is now basically regarded as the main content file, every other piece of content (including other .md files) is now regarded as resource to that content which you can refer to with the relevant shortcodes and also use in your templates with the Page.Resources
function
Just think of the two types of bundles as following:
- Leaf bundle: Single page (e.g. blog post or anything else), uses index.md
- Branch bundle: Section, taxonomy list, can contain other bundles, pages in there will be published normally, uses _index.md
This post is a summary of the information written above by the others but I felt it was necessary to make it clear again that both index.* and _index.* can be used but it’s important to know when to use which one of them.