mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
@@ -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 {
|
||||
|
Reference in New Issue
Block a user