Add IsTranslated to Node and Page

Makes the templates simpler.

See #2309
This commit is contained in:
Bjørn Erik Pedersen committed 2016-09-06 18:32:19 +03:00
1 parent c714d534f4
commit b6f3bfb800
1 file changed
+3 -4
+3 -4
View File
@@ -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>