mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Use the tree for taxonomy.Pages()
This commit is contained in:
@@ -827,6 +827,20 @@ func (b *pagesMapBucket) getTaxonomies() page.Pages {
|
||||
return b.sections
|
||||
}
|
||||
|
||||
func (b *pagesMapBucket) getTaxonomyEntries() page.Pages {
|
||||
var pas page.Pages
|
||||
ref := b.owner.treeRef
|
||||
viewInfo := ref.n.viewInfo
|
||||
prefix := strings.ToLower("/" + viewInfo.name.plural + "/" + viewInfo.termKey + "/")
|
||||
ref.m.taxonomyEntries.WalkPrefix(prefix, func(s string, v interface{}) bool {
|
||||
n := v.(*contentNode)
|
||||
pas = append(pas, n.viewInfo.ref.p)
|
||||
return false
|
||||
})
|
||||
page.SortByDefault(pas)
|
||||
return pas
|
||||
}
|
||||
|
||||
type sectionAggregate struct {
|
||||
datesAll resource.Dates
|
||||
datesSection resource.Dates
|
||||
|
Reference in New Issue
Block a user