diff options
Diffstat (limited to 'resources/page/taxonomy.go')
-rw-r--r-- | resources/page/taxonomy.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/resources/page/taxonomy.go b/resources/page/taxonomy.go index 7258ec197..2732c8040 100644 --- a/resources/page/taxonomy.go +++ b/resources/page/taxonomy.go @@ -112,6 +112,14 @@ func (i Taxonomy) ByCount() OrderedTaxonomy { return ia } +// Page returns the taxonomy page or nil if the taxonomy has no terms. +func (i Taxonomy) Page() Page { + for _, v := range i { + return v.Page().Parent() + } + return nil +} + // Pages returns the Pages for this taxonomy. func (ie OrderedTaxonomyEntry) Pages() Pages { return ie.WeightedPages.Pages() |