Describe .Language.LanguageCode fallback value

Co-authored-by: chalin <chalin@users.noreply.github.com>
This commit is contained in:
Joe Mooring 2024-05-13 09:25:41 -07:00 committed by GitHub
parent 3336532fe5
commit efad994ee0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -328,8 +328,11 @@ See [image processing configuration](/content-management/image-processing/#imagi
(`string`) A language tag as defined by [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). This value is used to populate:
- The `<language>` element in the internal [RSS template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml)
- The `lang` attribute of the `<html>` element in the internal [alias template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/alias.html)
- The `<language>` element in the embedded [RSS template]({{% eturl rss %}})
- The `lang` attribute of the `<html>` element in the embedded [alias template]({{% eturl alias %}})
- The `og:locale` `meta` element in the embedded [Open Graph template]({{% eturl opengraph %}})
When present in the root of the configuration, this value is ignored if one or more language keys exists. Please specify this value independently for each language key.
###### languages

View File

@ -34,7 +34,7 @@ Lang
```
LanguageCode
: (`string`) The language code from the site configuration.
: (`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
```go-html-template
{{ .Language.LanguageCode }} → de-DE

View File

@ -35,7 +35,7 @@ Lang
```
LanguageCode
: (`string`) The language code from the site configuration.
: (`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
```go-html-template
{{ .Site.Language.LanguageCode }} → de-DE