Issues rendering site with v0.32.2

My site is no longer rendering as expected with version 0.32.2. The issue has to do with how I handle index pages within sections. As of v0.31.1 I used an index.md page with a url frontmatter parameter, which renders a homepage for the section along with single pages from that section.

As of version 0.32.2 either my section homepage or section pages will not render depending on how I name my index file:

If my section index is called _index.md, then the section homepage is not rendered, but all of the single pages are.

If my section index is called index.md, then my section homepage is rendered, but none of the single pages are.

This is all tied up with the introduction of page bundles, which I admit I haven’t had a chance to work with much yet.

Workaround

Changing the name of the section homepage file to homepage.md and including a url in the frontmatter seems toget me back to where I was.

Question

How were people handling section indices before version 0.32.2? It doesn’t feel right writing content in a section layout file. I don’t feel like I should need to have a different layout file for every one of my sections when a single template should do the trick.

I haven’t read the details here, but section indices’ co.ntent files should be named “_index.md” and similar. Not sure what you mean by “section home page”.

In my use case the “section homepage” = a single content page rather than a list page.

Example: https://www.fws.gov/southeast/endangered-species-act/

When using _index.md the content page is not rendered in my case.


I am glad you posted this. I am new to hugo and thought it was me. I seem to have the same problem where none of the single pages get rendered.

If you use homebrew it’s pretty easy to bounce back a version.

$ brew switch hugo 0.31.1

Not rendering because the _index.md refers to the template list.html and not single.html.

What you’ve been doing has been non standard for a while, so no wonder your sections broke with the new version.

But you need to read the Docs about the new.Resources and see the Hugo 0.32 test repo.

I think that you will be able to render your page like you did before, in Hugo 0.32.

PS And to answer your last question you don’t need to write content in a section template.

@rhewitt what you want isn’t possible (it was possible in the previous version, but that change has been announced for 8 months …).

I understand that the template lookup isn’t as flexible as they should be for list pages (there is an issue for that), but in principle, I don’t see how a “single page” would be better than a “section page” (which is, conceptually, the section home page).

It seems like there are at least two clear use cases for section homepages.

  1. To list out all of the content from your section (like a blog)
  2. Modeled more like a traditional website with index.html just being a reserved name for a directory’s homepage.

If I wanted to continue to name my section homepage index.md I would need to create a duplicate file in site/layouts/section/<section>.html or create a homepage type so I could basically reproduce my single template. Either way that’s unnecessary duplication.

homepage.md is just as arbitrary as index.md, but it falls back on my single template rather than a list template. This is the behavior I’m looking for when my section homepage is just a single piece of content and not intended to list out the content from the current section.

I’ll track down the issue in GitHub so I can articulate my use-case.

@bep Was this the issue you were thinking about?

If you use base templates + partials that duplication should hardly be an issue. And, as always, I prefer a working solution with a little duplication before a non-working solution 100 out of 100 times.

1 Like

Feature request: Ability to override template type (list vs. single) in frontmatter #4230