diff options
Diffstat (limited to 'hugolib/hugo_sites.go')
-rw-r--r-- | hugolib/hugo_sites.go | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go index c028dad4a..59cde0406 100644 --- a/hugolib/hugo_sites.go +++ b/hugolib/hugo_sites.go @@ -337,6 +337,11 @@ func (h *HugoSites) createMissingPages() error { } } + // Will create content-less root sections. + newSections := s.assembleSections() + s.Pages = append(s.Pages, newSections...) + newPages = append(newPages, newSections...) + // taxonomy list and terms pages taxonomies := s.Language.GetStringMapString("taxonomies") if len(taxonomies) > 0 { @@ -384,33 +389,6 @@ func (h *HugoSites) createMissingPages() error { } } } - - if s.isEnabled(KindSection) { - sectionPages := s.findPagesByKind(KindSection) - if len(sectionPages) < len(s.Sections) { - for name, section := range s.Sections { - // A section may be created for the root content folder if a - // content file is placed there. - // We cannot create a section node for that, because - // that would overwrite the home page. - if name == "" { - continue - } - foundSection := false - for _, sectionPage := range sectionPages { - if sectionPage.sections[0] == name { - foundSection = true - break - } - } - if !foundSection { - n := s.newSectionPage(name, section) - s.Pages = append(s.Pages, n) - newPages = append(newPages, n) - } - } - } - } } if len(newPages) > 0 { |