mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
Handle Taxonomy permalinks
Return the correct virtual Section for Taxonomy and TaxonomyTerm. Restrict permalink expansion to only Pages and Taxonomies, but then actually use expanded permalinks even for non-Pages. Fixes #1208.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
23ba779fab
commit
d9a78b61ad
@@ -758,7 +758,7 @@ func (p *Page) Type() string {
|
||||
// since Hugo 0.22 we support nested sections, but this will always be the first
|
||||
// element of any nested path.
|
||||
func (p *Page) Section() string {
|
||||
if p.Kind == KindSection {
|
||||
if p.Kind == KindSection || p.Kind == KindTaxonomy || p.Kind == KindTaxonomyTerm {
|
||||
return p.sections[0]
|
||||
}
|
||||
return p.Source.Section()
|
||||
|
Reference in New Issue
Block a user