Nested headless folders

I have a question about using headless pages.

If I create the following content structure

|-- images
      |-- logo
            |-- index.md [headless = true]
      |-- branding
            |-- index.md [headless = true]

I get the warning: found no layout file for "HTML" for "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

If I change that structure to:

|-- images
      |-- index.md [headless = true]
      |-- logo
            |-- index.md
      |-- branding
            |-- index.md

The warning disappears, but logo and branding are not rendered as before.

The first folder will become a section if it’s not a page (headless or not). There is no way around that.

What I would suggest you do is to put your headless bundles either on top level or into an existing section (e.g. /blog/images).

2 Likes

… or you can put disableKinds = ["section"] in your config.

1 Like

Thanks bep, appreciate the help and all the work you do on here. happy holidays.

1 Like