diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-01-15 18:45:51 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-01-16 15:34:16 +0100 |
commit | f38a2fbd2e4de7f095a833b448cb8bc053955ce2 (patch) | |
tree | 3c88d0c12efa09ef3cc189a5859620b771004c7f /modules | |
parent | 6a579ebac3a81df61f22988e3eb55f7cb35ce523 (diff) | |
download | hugo-f38a2fbd2e4de7f095a833b448cb8bc053955ce2.tar.gz hugo-f38a2fbd2e4de7f095a833b448cb8bc053955ce2.zip |
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')
-rw-r--r-- | modules/collect.go | 14 |
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 + } } } |