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
This commit is contained in:
Bjørn Erik Pedersen 2023-01-15 18:45:51 +01:00
parent 6a579ebac3
commit f38a2fbd2e
7 changed files with 111 additions and 24 deletions

View file

@ -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
}
}
}