Skip to content

Commit

Permalink
Restrict the new type layout resolution to page and section kinds
Browse files Browse the repository at this point in the history
Will have to test and evaluate this a little.

See  #4891
  • Loading branch information
bep committed Jun 30, 2018
1 parent c790029 commit 78e8a74
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions hugolib/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 78e8a74

Please sign in to comment.