_index.md utility

After reading Relationship between _index.md and index.html my take away is that you use _index.md if you have front matter. But in my experience any markdown file can have markdown?

IIUC _index.md is only useful… I think, for list pages?

I’m trying to document my understanding eventually here: https://dabase.com/e/04066/

I’m not quite sure I understand what your question is here.

You don’t need to have an _index.md: https://gohugo.io/templates/lists/#list-pages-without-_indexmd

You do not have to create an _index.md file for every list page (i.e. section, taxonomy, taxonomy terms, etc) or the homepage. If Hugo does not find an _index.md within the respective content section when rendering a list template, the page will be created but with no {{.Content}} and only the default values for .Title etc.

Sorry any content/$name.md can be used with Frontmatter. As you point out https://gohugo.io/templates/lists/#list-pages-without-_indexmd is what I was missing.

If it’s optional I’m almost think, why have it? The confusion _index.md creates is quite something.

Sometimes one needs to enter meta data on a specific page list. _index.md makes this possible.

Also one can specify a cascade for a specific section through the front matter of an _index.md.

These are just a few use cases.

1 Like

Well there must be a lot of pages like mine that sort of mix _index.md (list) and actual index.md style content. I guess there is no harm, other than confusion.