summaryrefslogtreecommitdiffstats
path: root/modules/collect.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-01-15 18:45:51 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-01-16 15:34:16 +0100
commitf38a2fbd2e4de7f095a833b448cb8bc053955ce2 (patch)
tree3c88d0c12efa09ef3cc189a5859620b771004c7f /modules/collect.go
parent6a579ebac3a81df61f22988e3eb55f7cb35ce523 (diff)
Make hugo.toml the new config.toml
Both will of course work, but hugo.toml will win if both are set. We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some JSON config schema from some random other software which also names its config files config.toml. Fixes #8979
Diffstat (limited to 'modules/collect.go')
-rw-r--r--modules/collect.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/collect.go b/modules/collect.go
index ae6df9be9..fcde1d379 100644
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -423,12 +423,14 @@ func (c *collector) applyThemeConfig(tc *moduleAdapter) error {
err error
)
- // Viper supports more, but this is the sub-set supported by Hugo.
- for _, configFormats := range config.ValidConfigFileExtensions {
- configFilename = filepath.Join(tc.Dir(), "config."+configFormats)
- hasConfigFile, _ = afero.Exists(c.fs, configFilename)
- if hasConfigFile {
- break
+LOOP:
+ for _, configBaseName := range config.DefaultConfigNames {
+ for _, configFormats := range config.ValidConfigFileExtensions {
+ configFilename = filepath.Join(tc.Dir(), configBaseName+"."+configFormats)
+ hasConfigFile, _ = afero.Exists(c.fs, configFilename)
+ if hasConfigFile {
+ break LOOP
+ }
}
}