summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-17 18:45:23 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-17 22:13:29 +0200
commit8a69ccbb00e7978c6c5d57e353ce178c2b732b07 (patch)
treeb2f4a1438ae504555571b3e71a205c9022ec68b2 /hugolib
parent7ce033a89d411036e40dbb42325e30e12248bda9 (diff)
commands: Improve the common build flag handling
Updates #10947
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/content_map_page.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index 1b6fd40e9..6f02e2e29 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -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) {