diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-02-10 22:05:17 +0100 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-02-10 22:05:26 +0100 |
commit | a33bb33f189a565c848819181b1b87e66d020c58 (patch) | |
tree | d10f0e4ff9365115ebbeb4fa537144ed1d5ace79 /layouts/partials/docs/languages.html | |
parent | 7f25a125aa5bf015546568454f599ed6f56e1165 (diff) |
Make translations list respect weight of languages
Diffstat (limited to 'layouts/partials/docs/languages.html')
-rw-r--r-- | layouts/partials/docs/languages.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/layouts/partials/docs/languages.html b/layouts/partials/docs/languages.html index 63404a9..497e827 100644 --- a/layouts/partials/docs/languages.html +++ b/layouts/partials/docs/languages.html @@ -1,10 +1,10 @@ <!-- Merge home and current page translations --> -{{ $langs := dict }} +{{ $translations := dict }} {{ range .Site.Home.AllTranslations }} - {{ $langs = merge $langs (dict .Language.Lang .) }} + {{ $translations = merge $translations (dict .Language.Lang .) }} {{ end }} {{ range .Translations }} - {{ $langs = merge $langs (dict .Language.Lang .) }} + {{ $translations = merge $translations (dict .Language.Lang .) }} {{ end }} <div class="book-languages" tabindex="0" aria-haspopup="true"> @@ -16,14 +16,14 @@ </ul> <ul class="book-languages-list"> - {{ range sort $langs }} + {{ range .Site.Languages }}{{ with index $translations .Lang }} <li class="{{ if (eq $.Site.Language .Language) }}active{{ end }}"> - <a href="{{ .Permalink }}" class="flex"> + <a href="{{ .RelPermalink }}" class="flex"> <img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" /> {{ .Language.LanguageName }} </a> </li> - {{ end }} + {{ end }}{{ end }} </ul> </div> |