To add to the lookup posts, I have created a minimal site+theme that demonstrates what I think is a common use case. (All my template knowledge has come from cribbing Hugo themes over the years.)
I have three sections: uses-section
, uses-list
, uses-single
.
uses-section
is just a standard_index.md
file in a section rootuses-list
haslayout = 'list'
uses-single
haslayout = 'single'
This works as expected in hugo@145, but all three use section.html
in hugo@146.
There are three page templates in the theme layouts
:
single.html
is a single pagelist.html
uses paginationsection.html
is a stripped-back single page, to introduce a section without listing its contents
Am I just Doing This Wrong™?
Thanks,
Daniel
To reproduce (each template renders its name surrounded by ==
signs):
% git clone https://github.com/tastapod/template-order && cd template-order
% hugo@145 --cleanDestinationDir --quiet && grep -r == public
public/uses-section/index.html:== section ==
public/index.html:== home ==
public/tags/index.html:== list ==
public/uses-list/index.html:== list ==
public/uses-single/index.html:== single ==
public/categories/index.html:== list ==
% hugo@146 --cleanDestinationDir --quiet && grep -r == public
public/uses-section/index.html:== section ==
public/index.html:== home ==
public/tags/index.html:== list ==
public/uses-list/index.html:== section ==
public/uses-single/index.html:== section ==
public/categories/index.html:== list ==