summaryrefslogtreecommitdiffstats
path: root/hugolib/config.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-03-19 11:05:17 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-03-20 13:34:51 +0100
commit7ed56c6941edfdfa42eef2b779020b5d46ca194a (patch)
tree201e93428481a0f73551a541e7c3453ee9440adc /hugolib/config.go
parent24c716cac35b0c5476944108e545058749c43e61 (diff)
Fix OS env override for nested config param only available in theme
Fixes #8346
Diffstat (limited to 'hugolib/config.go')
-rw-r--r--hugolib/config.go71
1 files changed, 35 insertions, 36 deletions
diff --git a/hugolib/config.go b/hugolib/config.go
index 5ef78acf4..fe138bf20 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -18,6 +18,7 @@ import (
"path/filepath"
"strings"
+ "github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/common/types"
"github.com/gobwas/glob"
@@ -27,8 +28,6 @@ import (
"github.com/gohugoio/hugo/cache/filecache"
- "github.com/gohugoio/hugo/common/maps"
-
"github.com/gohugoio/hugo/parser/metadecoders"
"github.com/gohugoio/hugo/common/herrors"
@@ -167,6 +166,40 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
}
}
+ // We made this a Glob pattern in Hugo 0.75, we don't need both.
+ if v.GetBool("ignoreVendor") {
+ helpers.Deprecated("--ignoreVendor", "--ignoreVendorPaths **", false)
+ v.Set("ignoreVendorPaths", "**")
+ }
+
+ modulesConfig, err := l.loadModulesConfig(v)
+ if err != nil {
+ return v, configFiles, err
+ }
+
+ // Need to run these after the modules are loaded, but before
+ // they are finalized.
+ collectHook := func(m *modules.ModulesConfig) error {
+ if err := loadLanguageSettings(v, nil); err != nil {
+ return err
+ }
+
+ mods := m.ActiveModules
+
+ // Apply default project mounts.
+ if err := modules.ApplyProjectConfigDefaults(v, mods[0]); err != nil {
+ return err
+ }
+
+ return nil
+ }
+
+ _, modulesConfigFiles, err := l.collectModules(modulesConfig, v, collectHook)
+
+ if err == nil && len(modulesConfigFiles) > 0 {
+ configFiles = append(configFiles, modulesConfigFiles...)
+ }
+
const delim = "__env__delim"
// Apply environment overrides
@@ -222,40 +255,6 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
}
- // We made this a Glob pattern in Hugo 0.75, we don't need both.
- if v.GetBool("ignoreVendor") {
- helpers.Deprecated("--ignoreVendor", "--ignoreVendorPaths **", false)
- v.Set("ignoreVendorPaths", "**")
- }
-
- modulesConfig, err := l.loadModulesConfig(v)
- if err != nil {
- return v, configFiles, err
- }
-
- // Need to run these after the modules are loaded, but before
- // they are finalized.
- collectHook := func(m *modules.ModulesConfig) error {
- if err := loadLanguageSettings(v, nil); err != nil {
- return err
- }
-
- mods := m.ActiveModules
-
- // Apply default project mounts.
- if err := modules.ApplyProjectConfigDefaults(v, mods[0]); err != nil {
- return err
- }
-
- return nil
- }
-
- _, modulesConfigFiles, err := l.collectModules(modulesConfig, v, collectHook)
-
- if err == nil && len(modulesConfigFiles) > 0 {
- configFiles = append(configFiles, modulesConfigFiles...)
- }
-
return v, configFiles, err
}