From 7fc7bf862123e5ef2f6e80f27ec2778b0903f731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 17 May 2023 11:48:33 +0200 Subject: [PATCH] Add a note about some changes in 0.112.0 It needs to be improved, but I need something to link to from the warning message. --- content/en/content-management/multilingual.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 7e38b96f9..0ede77bab 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -69,6 +69,35 @@ Only the obvious non-global options can be overridden per language. Examples of **Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `defaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344) +### Changes in Hugo 0.112.0 + +{{< new-in "0.112.0 >}} + +In version `0.112.0` of Hugo we did a major we consolidated all configuration options, but also improved how the languages and their params gets merged with the main configuration. But while testing this on Hugo sites out there, we got some error reports. + +1. `site.Language.Params` is deprecated. Use `site.Params` directly. +1. The `params` sections on site and language is the only place to put custom user parameters, and `site.Params` will only contain these user defined parameters (see example below). + +```toml +title = "My blog" +languageCode = "en-us" + +[languages] +[languages.sv] +title = "Min blogg" +languageCode = "sv" +[languages.en.params] +color = "blue" +``` + +In the example above, all the settings exept the `color` below `params` maps to predefined configuration options in Hguo for the site and its language, and should be accessed via the documented accessors: + +``` +{{ site.Title }} +{{ site.LanguageCode }} +{{ site.Params.color }} +``` + ### Disable a Language You can disable one or more languages. This can be useful when working on a new translation.