Fixing UX-issue with language-switcher

This commit is contained in:
Maksim Iakunin 2021-11-07 15:20:24 +03:00
parent 837417e19f
commit 07cd76e783
No known key found for this signature in database
GPG Key ID: 629DE6EA48DAF1F4

View File

@ -1,5 +1,16 @@
<ul class="language-select">
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ if .IsTranslated }}
{{ $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 }}
{{ end }}
</ul>
{{ end }}
</ul>