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.
// Tax term: taxonomy/" + singular + ".terms.rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"
const (
// The RSS templates doesn't map easily into the regular pages.
layoutsRSSHome = `NAME.SUFFIX _default/NAME.SUFFIX _internal/_default/rss.xml`
layoutsRSSSection = `section/SECTION.NAME.SUFFIX _default/NAME.SUFFIX NAME.SUFFIX _internal/_default/rss.xml`
layoutsRSSTaxonomy = `taxonomy/SECTION.NAME.SUFFIX _default/NAME.SUFFIX NAME.SUFFIX _internal/_default/rss.xml`
layoutsRSSTaxonomyTerm = `taxonomy/SECTION.terms.NAME.SUFFIX _default/NAME.SUFFIX NAME.SUFFIX _internal/_default/rss.xml`
layoutsHome = "index.NAME.SUFFIX index.SUFFIX _default/list.NAME.SUFFIX _default/list.SUFFIX"
layoutsSection = `
section/SECTION.NAME.SUFFIX section/SECTION.SUFFIX
SECTION/list.NAME.SUFFIX SECTION/list.SUFFIX
_default/section.NAME.SUFFIX _default/section.SUFFIX
_default/list.NAME.SUFFIX _default/list.SUFFIX
indexes/SECTION.NAME.SUFFIX indexes/SECTION.SUFFIX
_default/indexes.NAME.SUFFIX _default/indexes.SUFFIX
`
layoutsTaxonomy = `
taxonomy/SECTION.NAME.SUFFIX taxonomy/SECTION.SUFFIX
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