mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 05:30:54 +03:00
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:
parent
6a579ebac3
commit
f38a2fbd2e
7 changed files with 111 additions and 24 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue