Fix taxonomy

Recently introduced in master.

See https://github.com/gohugoio/hugo/issues/6897#issuecomment-587499907
This commit is contained in:
Bjørn Erik Pedersen
2020-02-18 16:16:09 +01:00
parent 19e12caf8c
commit 1b7acfe763
3 changed files with 35 additions and 0 deletions

View File

@@ -533,6 +533,7 @@ func (m *contentMap) getPage(section, name string) *contentNode {
func (m *contentMap) getSection(s string) (string, *contentNode) {
k, v, found := m.sections.LongestPrefix(path.Dir(s))
if found {
return k, v.(*contentNode)
}
@@ -919,6 +920,9 @@ func (c *contentTreeRef) isSection() bool {
}
func (c *contentTreeRef) getSection() (string, *contentNode) {
if c.t == c.m.taxonomies {
return c.m.getTaxonomyParent(c.key)
}
return c.m.getSection(c.key)
}