Revert "Consider root and current section's content type if set in front matter"

This reverts commit c790029e1d.
This commit is contained in:
Bjørn Erik Pedersen
2018-07-09 10:29:18 +02:00
parent 5dc1f95b63
commit 179de5f5bc
5 changed files with 7 additions and 67 deletions

View File

@@ -58,29 +58,6 @@ func (p *Page) CurrentSection() *Page {
return v.parent
}
// FirstSection returns the section on level 1 below home, e.g. "/docs".
// For the home page, this will return itself.
func (p *Page) FirstSection() *Page {
v := p
if v.origOnCopy != nil {
v = v.origOnCopy
}
if v.parent == nil || v.parent.IsHome() {
return v
}
parent := v.parent
for {
current := parent
parent = parent.parent
if parent == nil || parent.IsHome() {
return current
}
}
}
// InSection returns whether the given page is in the current section.
// Note that this will always return false for pages that are
// not either regular, home or section pages.