This commit is contained in:
Maksim Iakunin 2021-11-07 18:16:42 +03:00
parent 07cd76e783
commit 94ae51278b
No known key found for this signature in database
GPG Key ID: 629DE6EA48DAF1F4

View File

@ -1,16 +1,15 @@
{{ if .IsTranslated }}
<ul class="language-select">
{{ $pageLang := .Page.Lang}}
<ul class="language-select">
{{ range .AllTranslations }}
{{ if eq .Lang $pageLang }}
<li>
{{ .Language.LanguageName }}
</li>
{{ else }}
<li>
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end }}
{{ $translations := .AllTranslations }}
{{ if not .IsTranslated }}
{{ $translations = $.Site.Home.AllTranslations }}
{{ end }}
{{ range $translations }}
{{ if eq .Lang $pageLang }}
<li>{{ .Language.LanguageName }}</li>
{{ else }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</ul>