Move section initialization to Site.assembleSections

Closes #1527
This commit is contained in:
nitoyon
2015-10-28 01:55:57 +09:00
committed by Bjørn Erik Pedersen
parent 8fe48a6576
commit 72bda5ad26

View File

@@ -1243,7 +1243,6 @@ func (s *Site) assembleMenus() {
func (s *Site) assembleTaxonomies() {
s.Taxonomies = make(TaxonomyList)
s.Sections = make(Taxonomy)
taxonomies := viper.GetStringMapString("Taxonomies")
jww.INFO.Printf("found taxonomies: %#v\n", taxonomies)
@@ -1276,7 +1275,6 @@ func (s *Site) assembleTaxonomies() {
}
s.Info.Taxonomies = s.Taxonomies
s.Info.Sections = s.Sections
}
// Prepare pages for a new full build.
@@ -1291,6 +1289,9 @@ func (s *Site) resetPageBuildState() {
}
func (s *Site) assembleSections() {
s.Sections = make(Taxonomy)
s.Info.Sections = s.Sections
for i, p := range s.Pages {
s.Sections.add(p.Section(), WeightedPage{s.Pages[i].Weight, s.Pages[i]}, s.Info.preserveTaxonomyNames)
}