Merge pull request #115 from iakunin/2021-11-07-language-switcher
Fixing UX-issue with language-switcher
This commit is contained in:
commit
c0004087d8
@ -1,5 +1,15 @@
|
||||
<ul class="language-select">
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ $pageLang := .Page.Lang}}
|
||||
{{ $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 }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user