commands: Improve the common build flag handling

Updates #10947
This commit is contained in:
Bjørn Erik Pedersen
2023-05-17 18:45:23 +02:00
parent 7ce033a89d
commit 8a69ccbb00
16 changed files with 86 additions and 71 deletions

View File

@@ -743,9 +743,12 @@ func (m *pageMaps) AssemblePages() error {
sw := &sectionWalker{m: pm.contentMap}
a := sw.applyAggregates()
if a.mainSection != "" && len(pm.s.s.conf.C.MainSections) == 0 {
if a.mainSection != "" {
// Note, sites that have no custom config share a common config struct pointer.
// This means that we currently do not support setting different values per language.
// The end user can, however, configure this per language if needed.
mainSections := []string{strings.TrimRight(a.mainSection, "/")}
pm.s.s.conf.C.SetMainSections(mainSections)
pm.s.s.conf.C.SetMainSectionsIfNotSet(mainSections)
}
pm.s.lastmod = a.datesAll.Lastmod()
if resource.IsZeroDates(pm.s.home) {