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:
Bjørn Erik Pedersen 2018-06-30 16:50:02 +02:00
parent c790029e1d
commit 78e8a744b3
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -407,6 +407,7 @@ func (p *Page) createLayoutDescriptor() output.LayoutDescriptor {
var typeCurrentSection string
var typeRootSection string
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 {
@ -416,6 +417,7 @@ func (p *Page) createLayoutDescriptor() output.LayoutDescriptor {
if first != nil {
typeRootSection = first.contentType
}
}
return output.LayoutDescriptor{
Kind: p.Kind,