Skip to content

Commit

Permalink
Describe .Language.LanguageCode fallback value
Browse files Browse the repository at this point in the history
Co-authored-by: chalin <chalin@users.noreply.github.com>
  • Loading branch information
jmooring and chalin committed May 13, 2024
1 parent 3336532 commit efad994
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions content/en/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion content/en/methods/page/Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/en/methods/site/Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efad994

Please sign in to comment.