Closed
Description
What version of Hugo are you using (hugo version
)?
Hugo 0.146.7 and above
Does this issue reproduce with the latest release?
Yes, tested with 0.147.0
Summary
I have a site with two sections: blog
and blogroll
. Prior to 0.146.7, templates located in layouts/blogroll/
would apply to content in blogroll
. With 0.146.7 and 0.147.0, templates located in layouts/blog
are applied to blogroll
instead.
Steps to reproduce
- Create a new Hugo site
- Create template for
blog
:layouts/blog/list.html
- Create template for
blogroll
:layouts/blogroll/list.html
- Add content to
blog
andblogroll
- Run Hugo
Both public/blog/index.html
and public/blogroll/index.html
will be rendered with layouts/blog/list.html
.
I made a repo with a minimum reproducible example: https://github.com/lkhrs/hugo-template-match
Notes
- Appears to happen with any content directory that starts with
blog*
- Wrong template for
blogroll
,bloga
andblogs
blo
,sectionone
,sectiontwo
and other directories work as expected
- Wrong template for
- Tested with
list.html
andsingle.html
templates