From 72bda5ad268866e02bfab7ccf76d9224db6ec7b6 Mon Sep 17 00:00:00 2001 From: nitoyon Date: Wed, 28 Oct 2015 01:55:57 +0900 Subject: [PATCH] Move section initialization to Site.assembleSections Closes #1527 --- hugolib/site.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hugolib/site.go b/hugolib/site.go index f7615170c..92fd2ffab 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -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) }