aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/config.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-07-15 15:31:50 +0200
committerBjørn Erik Pedersen <[email protected]>2021-07-15 16:15:32 +0200
commitae6cf93c84c3584b111f4b9fa3fb4e3f63d37915 (patch)
tree3dc0411801105a70d20ab426cbf7df62b9979815 /hugolib/config.go
parenta70da2b74a6af0834cce9668cdb6acdb1c86a4c0 (diff)
downloadhugo-ae6cf93c84c3584b111f4b9fa3fb4e3f63d37915.tar.gz
hugo-ae6cf93c84c3584b111f4b9fa3fb4e3f63d37915.zip
Fix default values when loading from config dir
By waiting until we've loaded the config dir config before applying the default values. Fixes #8763
Diffstat (limited to 'hugolib/config.go')
-rw-r--r--hugolib/config.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/hugolib/config.go b/hugolib/config.go
index 65b269ab6..694f34615 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -78,10 +78,6 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
}
}
- if err := l.applyConfigDefaults(); err != nil {
- return l.cfg, configFiles, err
- }
-
if d.AbsConfigDir != "" {
dcfg, dirnames, err := config.LoadConfigFromDir(l.Fs, d.AbsConfigDir, l.Environment)
if err == nil {
@@ -97,6 +93,10 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
}
}
+ if err := l.applyConfigDefaults(); err != nil {
+ return l.cfg, configFiles, err
+ }
+
l.cfg.SetDefaultMergeStrategy()
// We create languages based on the settings, so we need to make sure that