Handle transient errors in config loading etc.

As in: Get the Kubernetes site to build with the new Hugo version.

Updates #10947
This commit is contained in:
Bjørn Erik Pedersen 2023-05-17 13:12:49 +02:00
parent 5251f015bf
commit 05542130ba
7 changed files with 96 additions and 5 deletions

View file

@ -87,7 +87,8 @@ var DeprecationFunc = func(item, alternative string, err bool) {}
const paramsDeprecationWarning = `.Language.Params is deprecated and will be removed in a future release. Use site.Params instead.
Also, for all but custom parameters, you need to use the built in Hugo variables, e.g. site.Title, site.LanguageCode; site.Language.Params.Title will not work.
- For all but custom parameters, you need to use the built in Hugo variables, e.g. site.Title, site.LanguageCode; site.Language.Params.Title will not work.
- All custom parameters needs to be placed below params, e.g. [languages.en.params] in TOML.
See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120
@ -111,6 +112,10 @@ func (l *Language) loadLocation(tzStr string) error {
return nil
}
func (l *Language) String() string {
return l.Lang
}
// Languages is a sortable list of languages.
type Languages []*Language