diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-08-09 15:26:55 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-09-06 18:32:19 +0300 |
commit | 76108440043094b3841ef96cd1eda8274345430b (patch) | |
tree | 9be50c884ed875c8b6920d36cf4d3ffc18309b3c /docs | |
parent | 8b55bfc81438f33892611a8e828107791838ccdb (diff) |
Add IsTranslated to Node and Page
Makes the templates simpler.
See #2309
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/content/multilingual.md | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/content/content/multilingual.md b/docs/content/content/multilingual.md index f5ff46f9c..7e1df45e1 100644 --- a/docs/content/content/multilingual.md +++ b/docs/content/content/multilingual.md @@ -93,13 +93,12 @@ By having the same _base file name_, the content pieces are linked together as t To create a list of links to translated content, use a template similar to this: ``` -{{ $translations := .Translations }} -{{ if gt (len $translations) 0 }} +{{ if .IsTranslated }} <h4>{{ i18n "translations" }}</h4> <ul> - {{ range $translations }} + {{ range .Translations }} <li> - <a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}</a> + <a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a> </li> {{ end}} </ul> |