diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/allconfig/allconfig.go | 9 | ||||
-rw-r--r-- | config/allconfig/alldecoders.go | 12 |
2 files changed, 13 insertions, 8 deletions
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go index 469a164cf..9cafc876e 100644 --- a/config/allconfig/allconfig.go +++ b/config/allconfig/allconfig.go @@ -671,6 +671,13 @@ type Configs struct { configLangs []config.AllProvider } +func (c *Configs) Validate(logger loggers.Logger) error { + for p := range c.Base.Cascade.Config { + page.CheckCascadePattern(logger, p) + } + return nil +} + // transientErr returns the last transient error found during config compilation. func (c *Configs) transientErr() error { for _, l := range c.LanguageConfigSlice { @@ -969,7 +976,7 @@ func decodeConfigFromParams(fs afero.Fs, logger loggers.Logger, bcfg config.Base }) for _, v := range decoderSetups { - p := decodeConfig{p: p, c: target, fs: fs, logger: logger, bcfg: bcfg} + p := decodeConfig{p: p, c: target, fs: fs, 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 9c1d08144..5d31d5d35 100644 --- a/config/allconfig/alldecoders.go +++ b/config/allconfig/alldecoders.go @@ -18,7 +18,6 @@ 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" @@ -43,11 +42,10 @@ import ( ) type decodeConfig struct { - p config.Provider - c *Config - fs afero.Fs - logger loggers.Logger - bcfg config.BaseConfig + p config.Provider + c *Config + fs afero.Fs + bcfg config.BaseConfig } type decodeWeight struct { @@ -293,7 +291,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.logger, p.p.Get(d.key)) + p.c.Cascade, err = page.DecodeCascadeConfig(nil, p.p.Get(d.key)) return err }, }, |