shithub: hugo

Download patch

ref: 72bda5ad268866e02bfab7ccf76d9224db6ec7b6
parent: 8fe48a657642c4fc9855a62e9517509b10b0cbbd
author: nitoyon <[email protected]>
date: Tue Oct 27 21:55:57 EDT 2015

Move section initialization to Site.assembleSections

Closes #1527

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1243,7 +1243,6 @@
 
 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 @@
 	}
 
 	s.Info.Taxonomies = s.Taxonomies
-	s.Info.Sections = s.Sections
 }
 
 // Prepare pages for a new full build.
@@ -1291,6 +1289,9 @@
 }
 
 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)
 	}