Misc doc, code refactoring to improve documentation

This commit is contained in:
Bjørn Erik Pedersen
2022-12-30 09:20:58 +01:00
parent 3c51625c71
commit e402d91ee1
47 changed files with 238 additions and 95 deletions

View File

@@ -266,7 +266,7 @@ func (m *pageMap) newResource(fim hugofs.FileMetaInfo, owner *pageState) (resour
}
func (m *pageMap) createSiteTaxonomies() error {
m.s.taxonomies = make(TaxonomyList)
m.s.taxonomies = make(page.TaxonomyList)
var walkErr error
m.taxonomies.Walk(func(s string, v any) bool {
n := v.(*contentNode)
@@ -275,7 +275,7 @@ func (m *pageMap) createSiteTaxonomies() error {
viewName := t.name
if t.termKey == "" {
m.s.taxonomies[viewName.plural] = make(Taxonomy)
m.s.taxonomies[viewName.plural] = make(page.Taxonomy)
} else {
taxonomy := m.s.taxonomies[viewName.plural]
if taxonomy == nil {
@@ -285,7 +285,7 @@ func (m *pageMap) createSiteTaxonomies() error {
m.taxonomyEntries.WalkPrefix(s, func(ss string, v any) bool {
b2 := v.(*contentNode)
info := b2.viewInfo
taxonomy.add(info.termKey, page.NewWeightedPage(info.weight, info.ref.p, n.p))
taxonomy[info.termKey] = append(taxonomy[info.termKey], page.NewWeightedPage(info.weight, info.ref.p, n.p))
return false
})