Skip to content

Commit

Permalink
Update MultiLingual and MultiHost methods/functions
Browse files Browse the repository at this point in the history
- Deprecate .Site.MultiLingual in favor of hugo.IsMultilingual
- Rename hugo.IsMultiHost to hugo.IsMultihost. Cannot deprecate
  in documentation because they have the same published path, but this
  shouldn't be a problem because hugo.IsMultiHost was introduced in the
  last patch release.

See gohugoio/hugo#12232
  • Loading branch information
jmooring committed Mar 13, 2024
1 parent 5f81464 commit 09a94b9
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
3 changes: 2 additions & 1 deletion content/en/functions/hugo/IsMultihost.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ categories: []
keywords: []
action:
aliases: []
related: []
related:
- /functions/hugo/IsMultilingual
returnType: bool
signatures: [hugo.IsMultihost]
---
Expand Down
37 changes: 37 additions & 0 deletions content/en/functions/hugo/IsMultilingual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: hugo.IsMultilingual
description: Reports whether there are two or more configured languages.
categories: []
keywords: []
action:
related:
- /functions/hugo/IsMultihost
returnType: bool
signatures: [hugo.IsMultilingual]
---

{{< new-in v0.124.0 >}}

Site configuration:

{{< code-toggle file=hugo >}}
defaultContentLanguage = 'de'
defaultContentLanguageInSubdir = true
[languages]
[languages.de]
languageCode = 'de-DE'
languageName = 'Deutsch'
title = 'Projekt Dokumentation'
weight = 1
[languages.en]
languageCode = 'en-US'
languageName = 'English'
title = 'Project Documentation'
weight = 2
{{< /code-toggle >}}

Template:

```go-html-template
{{ hugo.IsMultilingual }} → true
```
8 changes: 7 additions & 1 deletion content/en/methods/site/IsMultiLingual.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: IsMultiLingual
description: Reports whether the site is multilingual.
description: Reports whether there are two or more configured languages.
categories: []
keywords: []
action:
Expand All @@ -9,6 +9,12 @@ action:
signatures: [SITE.IsMultiLingual]
---

{{% deprecated-in 0.124.0 %}}
Use [`hugo.IsMultilingual`] instead.

[`hugo.IsMultilingual`]: /functions/hugo/ismultilingual/
{{% /deprecated-in %}}

Site configuration:

{{< code-toggle file=hugo >}}
Expand Down

0 comments on commit 09a94b9

Please sign in to comment.