When content/index.md exists, no other files in content get rendered

Note: originally raised as a bug report on Github. I also searched the documentation while debugging this and couldn’t find anything.

Steps to reproduce:

Create new empty site.

Create a page in content and corresponding layout, e.g.

/content/test.md

---
title: "Test"
date: 2018-04-01T09:00:44+07:00
type: page
layout: test
---

JUST TESTING!

/layout/page/test.html

{{ .Content }}

Now the page will render correctly. However, add /content/index.md, which can contain anything and have any layout (that I tested), and suddenly test.md and any other content in /content stop being rendered.

If this is intended behaviour and not a bug, then what is the purpose? And where is it documented?

I think you want look at the new page bundles feature: https://gohugo.io/about/new-in-032/

What you describe is intended behaviour - i.e. you’re creating a leaf bundle at the root of your site.

It’s called Page Bundles and it’s documented extensively: https://gohugo.io/content-management/page-bundles/#readout

In the future, please read the Hugo Docs and search the forum (eg index.md has plenty of results here).

I’m closing this thread.