No list file being generated for new section

Hi all,

First time working with Hugo and I’m quite confused as to why it’s not generating a list html file for my blog section.

My file structure is as followed:

archetypes/
   blog.md
   work.md
content/
   blog/
      _index.md
      test.md
   work/
layout/
   _default/
      baseof.html
      list.html
      single.html
   blog/
      single.html
   partials/
      head.html
      footer.html
   index.html

When running Hugo, I was expecting a public/blog/index.html file to be created using the layout/_default/list.html. For some reason, this doesn’t happen. Can anyone help me?

If the description I gave here isn’t enough, the full repository for the site can be found here. https://github.com/samjmckenzie/sammckenzie.be

PS: For some reason, there does seem to be a public/blog/blog.html file being created filled with XMS for an RSS feed. Is this normal?

From looking at your repo, it seems there are two reasons:

  1. Your default list template is blank, so hugo doesn’t know how to create a list page.
  2. You don’t have any pages in your content/blog directory, so even if there was a template, there’d be nothing to populate it with.

I’m not sure why the RSS feed is where you’ve found it, it should be called index.xml (in the relevant directories) https://gohugo.io/templates/rss/#section-rss

Yeah, I forgot to add those files to the repo. Oops. But I found the issue: my _index.md file was following the archetype of blog.md and, for some odd reason, that seemed to be causing issues. I’ve made _index.md empty now and it’s working as intended. Thanks for the help.

1 Like