diff --git a/config/allconfig/load.go b/config/allconfig/load.go index 91cf1eb056b..b997c28969d 100644 --- a/config/allconfig/load.go +++ b/config/allconfig/load.go @@ -79,6 +79,7 @@ func LoadConfig(d ConfigSourceDescriptor) (*Configs, error) { if err := configs.transientErr(); err != nil { return nil, fmt.Errorf("failed to create config from modules config: %w", err) } + configs.LoadingInfo.ConfigFiles = append(configs.LoadingInfo.ConfigFiles, l.ModulesConfigFiles...) } else if err := configs.transientErr(); err != nil { return nil, fmt.Errorf("failed to create config: %w", err) } diff --git a/testscripts/commands/server__watch_moduleconfig.txt b/testscripts/commands/server__watch_moduleconfig.txt new file mode 100644 index 00000000000..0db24058a72 --- /dev/null +++ b/testscripts/commands/server__watch_moduleconfig.txt @@ -0,0 +1,21 @@ +hugo server --renderToDisk --disableLiveReload & + +waitServer +grep 'foo: bar' public/index.html +replace themes/mytheme/hugo.toml "bar" "baz" +sleep 4 +grep 'foo: baz' public/index.html +stopServer +! stderr . + + +-- hugo.toml -- +title = "Hugo Server Test" +baseURL = "https://example.org/" +disableKinds = ["section", "page", "taxonomy", "term", "RSS", "sitemap", "robotsTXT", "404"] +theme = "mytheme" +-- layouts/index.html -- +foo: {{ .Site.Params.foo }} +-- themes/mytheme/hugo.toml -- +[params] + foo = "bar"