diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-06-01 09:53:40 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-06-01 10:49:21 +0200 |
commit | 0ef29528469975bf2251dea78699dbeac55d02ae (patch) | |
tree | a37cd3b56f05bc651a9b6c3d265d9a9c06425757 /config | |
parent | e3ae8f025d5919dd6675d5176b10bcf8884baa95 (diff) |
commands: Add --lang to hugo config
Fixes #11057
Diffstat (limited to 'config')
-rw-r--r-- | config/allconfig/allconfig.go | 5 | ||||
-rw-r--r-- | config/allconfig/integration_test.go | 2 |
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") |