mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -367,7 +367,7 @@ type ConfigCompiled struct {
|
||||
func (c *ConfigCompiled) SetMainSectionsIfNotSet(sections []string) {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
if len(c.MainSections) > 0 {
|
||||
if c.MainSections != nil {
|
||||
return
|
||||
}
|
||||
c.MainSections = sections
|
||||
|
@@ -177,6 +177,9 @@ var allDecoderSetups = map[string]decodeWeight{
|
||||
// Before Hugo 0.112.0 this was configured via site Params.
|
||||
if mainSections, found := p.c.Params["mainsections"]; found {
|
||||
p.c.MainSections = types.ToStringSlicePreserveString(mainSections)
|
||||
if p.c.MainSections == nil {
|
||||
p.c.MainSections = []string{}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user