mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
node to page: Do not create section node for root
Because that will overwrite the home page, which is bad. Updates #2297
This commit is contained in:
@@ -461,6 +461,13 @@ func (h *HugoSites) createMissingNodes() error {
|
||||
sectionPages := s.findPagesByNodeType(NodeSection)
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user