summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-06-01 09:53:40 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-06-01 10:49:21 +0200
commit0ef29528469975bf2251dea78699dbeac55d02ae (patch)
treea37cd3b56f05bc651a9b6c3d265d9a9c06425757 /config
parente3ae8f025d5919dd6675d5176b10bcf8884baa95 (diff)
commands: Add --lang to hugo config
Fixes #11057
Diffstat (limited to 'config')
-rw-r--r--config/allconfig/allconfig.go5
-rw-r--r--config/allconfig/integration_test.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go
index 40bb2221d..ade9607dd 100644
--- a/config/allconfig/allconfig.go
+++ b/config/allconfig/allconfig.go
@@ -664,6 +664,11 @@ func (c *Configs) Init() error {
}
}
+ // Transfer the changed mounts to the language versions (all share the same mount set, but can be displayed in different languages).
+ for _, l := range c.LanguageConfigSlice {
+ l.Module.Mounts = c.Base.Module.Mounts
+ }
+
return nil
}
diff --git a/config/allconfig/integration_test.go b/config/allconfig/integration_test.go
index e96dbd296..2de83eaa4 100644
--- a/config/allconfig/integration_test.go
+++ b/config/allconfig/integration_test.go
@@ -60,7 +60,7 @@ Title: {{ .Title }}
b.Assert(enConcp.BaseURL().String(), qt.Equals, "https://example.com")
modConf := enConf.Module
- b.Assert(modConf.Mounts, qt.HasLen, 2)
+ b.Assert(modConf.Mounts, qt.HasLen, 8)
b.Assert(modConf.Mounts[0].Source, qt.Equals, filepath.FromSlash("content/en"))
b.Assert(modConf.Mounts[0].Target, qt.Equals, "content")
b.Assert(modConf.Mounts[0].Lang, qt.Equals, "en")