mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Restrict the new type layout resolution to page and section kinds
Will have to test and evaluate this a little. See #4891
This commit is contained in:
@@ -407,14 +407,16 @@ func (p *Page) createLayoutDescriptor() output.LayoutDescriptor {
|
||||
|
||||
var typeCurrentSection string
|
||||
var typeRootSection string
|
||||
curr := p.CurrentSection()
|
||||
// Make sure we use the contentType only. This is the value from front matter.
|
||||
if curr != nil {
|
||||
typeCurrentSection = curr.contentType
|
||||
}
|
||||
first := p.FirstSection()
|
||||
if first != nil {
|
||||
typeRootSection = first.contentType
|
||||
if p.Kind == KindPage || p.Kind == KindSection {
|
||||
curr := p.CurrentSection()
|
||||
// Make sure we use the contentType only. This is the value from front matter.
|
||||
if curr != nil {
|
||||
typeCurrentSection = curr.contentType
|
||||
}
|
||||
first := p.FirstSection()
|
||||
if first != nil {
|
||||
typeRootSection = first.contentType
|
||||
}
|
||||
}
|
||||
|
||||
return output.LayoutDescriptor{
|
||||
|
Reference in New Issue
Block a user