8000 Template lookup selects first match of "blog" over templates that start with "blog" · Issue #13672 · gohugoio/hugo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Template lookup selects first match of "blog" over templates that start with "blog" #13672
Closed
@lkhrs

Description

@lkhrs

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

  1. Create a new Hugo site
  2. Create template for blog: layouts/blog/list.html
  3. Create template for blogroll: layouts/blogroll/list.html
  4. Add content to blog and blogroll
  5. 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 and blogs
    • blo, sectionone, sectiontwo and other directories work as expected
  • Tested with list.html and single.html templates

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0