List of posts for a section

Say I have a folder called blobs in the content folder (which I think is called Section in Hugo terms), and I have a corresponding <theme>/layouts/blobs folder. For the path http://localhost:1313/blobs, I like to get a page with list of posts under blobs.

Currently, I have these and I am not able to get it to work:

  • An _index.md file under content/blobs
  • Under <theme>/layouts/blobs, I have index.html, and also single.html (which I think is not relevant to render the list of posts).

If I read the docs right, the _index.md of a section is matched with the index.html of the section (or the default). The index.html may use {{ .Content }} to render the content of _index.md. Am not able to get this to work.

What am I missing?

Change the index.html in layouts/blobs to list.html. index.html is for homepage and lives in the root of the layouts folder or inside the _defaults folder.

1 Like

Now that I try it in the morning, it seems obvious. Should never work late in the night :joy:. Thanks @Arif

Welcome. See Hugo's Lookup Order | Hugo.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.