mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 18:22:03 -05:00
5fd1e74903
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
1.1 KiB
1.1 KiB
title | description | categories | keywords | action | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IsTranslated | Reports whether the given page has one or more translations. |
|
With this site configuration:
{{< code-toggle file=hugo >}} defaultContentLanguage = 'en'
[languages.en] contentDir = 'content/en' languageCode = 'en-US' languageName = 'English' weight = 1
[languages.de] contentDir = 'content/de' languageCode = 'de-DE' languageName = 'Deutsch' weight = 2 {{< /code-toggle >}}
And this content:
content/
├── de/
│ ├── books/
│ │ └── book-1.md
│ └── _index.md
├── en/
│ ├── books/
│ │ ├── book-1.md
│ │ └── book-2.md
│ └── _index.md
└── _index.md
When rendering content/en/books/book-1.md:
{{ .IsTranslated }} → true
When rendering content/en/books/book-2.md:
{{ .IsTranslated }} → false