-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Milestone
Description
In relation to the new template system, this has been discussed before, but I'd like to revisit it.
Consider this project structure:
content/
└── p1.md
layouts/
├── page/
│ └── page.html
└── page.html
When the page type
is explicitly set to "page" in front matter, Hugo renders p1.md
using layouts/page/page.html
as expected.
However, when the page type
is implicitly set to "page" Hugo renders p1.md
using layouts/page.html
instead.
Without digging into the details, I suspect that this method has no impact on template selection:
Lines 226 to 238 in dd6e2c8
const defaultContentType = "page" | |
func (p *pageMeta) Type() string { | |
if p.pageConfig.Type != "" { | |
return p.pageConfig.Type | |
} | |
if sect := p.Section(); sect != "" { | |
return sect | |
} | |
return defaultContentType | |
} |
Reference: https://discourse.gohugo.io/t/possible-bug-single-layout-for-pages-in-v0-147-9/55179/