diff options
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index 2653479ea..47ca77016 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -94,7 +94,7 @@ type Site struct { Taxonomies TaxonomyList - taxonomyNodes taxonomyNodeInfos + taxonomyNodes *taxonomyNodeInfos Sections Taxonomy Info SiteInfo @@ -1566,24 +1566,23 @@ func (s *Site) assembleTaxonomies() error { s.Taxonomies[plural] = make(Taxonomy) } - s.taxonomyNodes = make(taxonomyNodeInfos) + s.taxonomyNodes = &taxonomyNodeInfos{ + m: make(map[string]*taxonomyNodeInfo), + getKey: s.getTaxonomyKey, + } s.Log.INFO.Printf("found taxonomies: %#v\n", taxonomies) for singular, plural := range taxonomies { - parent := s.taxonomyNodes.GetOrCreate(plural, "", "") + parent := s.taxonomyNodes.GetOrCreate(plural, "") parent.singular = singular addTaxonomy := func(plural, term string, weight int, p page.Page) { key := s.getTaxonomyKey(term) - n := s.taxonomyNodes.GetOrCreate(plural, key, term) + n := s.taxonomyNodes.GetOrCreate(plural, term) n.parent = parent - // There may be different spellings before normalization, so the - // last one will win, e.g. "hugo" vs "Hugo". - n.term = term - w := page.NewWeightedPage(weight, p, n.owner) s.Taxonomies[plural].add(key, w) |