From 30885a6c5f4083167ae81034bf6a656c07b5fc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 31 Jul 2023 19:18:36 +0200 Subject: [PATCH] Fix module config watch regression Fixes #11313 --- config/allconfig/load.go | 1 + .../commands/server__watch_moduleconfig.txt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 testscripts/commands/server__watch_moduleconfig.txt diff --git a/config/allconfig/load.go b/config/allconfig/load.go index 91cf1eb05..b997c2896 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 000000000..867669754 --- /dev/null +++ b/testscripts/commands/server__watch_moduleconfig.txt @@ -0,0 +1,19 @@ +hugo server --disableLiveReload & + +waitServer +stopServer +wait +! stderr . +stdout 'Watching for config changes in.*mytheme' + + +-- 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"