mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05: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:
parent
c790029e1d
commit
78e8a744b3
1 changed files with 10 additions and 8 deletions
|
@ -407,6 +407,7 @@ func (p *Page) createLayoutDescriptor() output.LayoutDescriptor {
|
||||||
|
|
||||||
var typeCurrentSection string
|
var typeCurrentSection string
|
||||||
var typeRootSection string
|
var typeRootSection string
|
||||||
|
if p.Kind == KindPage || p.Kind == KindSection {
|
||||||
curr := p.CurrentSection()
|
curr := p.CurrentSection()
|
||||||
// Make sure we use the contentType only. This is the value from front matter.
|
// Make sure we use the contentType only. This is the value from front matter.
|
||||||
if curr != nil {
|
if curr != nil {
|
||||||
|
@ -416,6 +417,7 @@ func (p *Page) createLayoutDescriptor() output.LayoutDescriptor {
|
||||||
if first != nil {
|
if first != nil {
|
||||||
typeRootSection = first.contentType
|
typeRootSection = first.contentType
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return output.LayoutDescriptor{
|
return output.LayoutDescriptor{
|
||||||
Kind: p.Kind,
|
Kind: p.Kind,
|
||||||
|
|
Loading…
Reference in a new issue