Homepage template isn't properly searched

Unable to locate layout for “home”: [index.html.html index.html _default/list.html.html _default/list.html theme/index.html.html theme/index.html theme/_default/list.html.html theme/_default/list.html]

Why does this not scan _default/single.html as mentioned in the docs? I’m using the latest version v0.22.1

This would allow me to not have a separate template just for the homepage.

Thanks.

Hugo’s default assumption is that the homepage will probably have a significantly different layout. If your site is like mine, you might want to specify most things in _default/baseof.html and override literally nothing in _default/single.html and index.html, like so:

{{ define "nothing" }}{{ end }}

This assumes that you don’t have a block labeled “nothing” in your _default/baseof.html. I don’t.

baseof/block/define is currently under-recommended in the docs (both current and arguably-better work-in-progress); this is slowly changing.

I was actually using blocks - I didn’t think to abstract everything in baseof.html, though! I may have been too focused on my initial plan. Thanks!

1 Like