diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-02-03 13:09:53 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-02-03 15:07:59 +0100 |
commit | 058f230a1be1abaf589b5a194ef6ec12d14c4021 (patch) | |
tree | 92d84e4e453c3e66075553445e09d78b3ae92d5d /config | |
parent | a66480f70c1ac734ba5af035e626d29ffcde157d (diff) | |
download | hugo-058f230a1be1abaf589b5a194ef6ec12d14c4021.tar.gz hugo-058f230a1be1abaf589b5a194ef6ec12d14c4021.zip |
Detect now invalid path patterns in cascade
Closes #11977
Diffstat (limited to 'config')
-rw-r--r-- | config/allconfig/allconfig.go | 2 | ||||
-rw-r--r-- | config/allconfig/alldecoders.go | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go index 413baebd1..7052f0abd 100644 --- a/config/allconfig/allconfig.go +++ b/config/allconfig/allconfig.go @@ -965,7 +965,7 @@ func decodeConfigFromParams(fs afero.Fs, logger loggers.Logger, bcfg config.Base }) for _, v := range decoderSetups { - p := decodeConfig{p: p, c: target, fs: fs, bcfg: bcfg} + p := decodeConfig{p: p, c: target, fs: fs, logger: logger, bcfg: bcfg} if err := v.decode(v, p); err != nil { return fmt.Errorf("failed to decode %q: %w", v.key, err) } diff --git a/config/allconfig/alldecoders.go b/config/allconfig/alldecoders.go index f96c19cfc..5ab76dec5 100644 --- a/config/allconfig/alldecoders.go +++ b/config/allconfig/alldecoders.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/gohugoio/hugo/cache/filecache" + "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/common/types" "github.com/gohugoio/hugo/config" @@ -42,10 +43,11 @@ import ( ) type decodeConfig struct { - p config.Provider - c *Config - fs afero.Fs - bcfg config.BaseConfig + p config.Provider + c *Config + fs afero.Fs + logger loggers.Logger + bcfg config.BaseConfig } type decodeWeight struct { @@ -291,7 +293,7 @@ var allDecoderSetups = map[string]decodeWeight{ key: "cascade", decode: func(d decodeWeight, p decodeConfig) error { var err error - p.c.Cascade, err = page.DecodeCascadeConfig(p.p.Get(d.key)) + p.c.Cascade, err = page.DecodeCascadeConfig(p.logger, p.p.Get(d.key)) return err }, }, |