Specifying the template to use for rendering the home page

Is it possible to specify the template that Hugo should use in order to render _index.md? (Ideally I would like to simply change type and layout, which does not work – see below.)

The main use case for this would be sites that consist mostly of single pages (rendered using layouts/_default/single.html), where the home page should have the same layout as the rest of the site.

Currently this does not seem to be possible without copying the template single.html to list.html or index.html, since home pages are always considered list pages.

What’s the most elegant solution here?

Example

~/hugo-temp % tree --dirsfirst content    
content
├── blog
│   ├── _index.md
│   ├── bazqux.md
│   ├── foobar.md
│   └── foobaz.md
├── _index.md
├── bar.md
├── baz.md
└── foo.md

In this case, I would like to render content/_index.md and content/foo.md using the same template, whereas content/blog/_index.md should be rendered using the list template.

Workarounds

(This thread evolved from my question here: Trying to understand spurious(?) “home page is blank” warnings.)

Two relevant issues that may help in the future:


Thanks for the reply, bep. I’ll make sure to keep an eye on these issues. Both sound very promising.

If there’s anything I can do to help, just let me know – I don’t want to spam the issue tracker.