mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-23 03:43:01 +00:00
33 lines
808 B
HTML
33 lines
808 B
HTML
{{ if .Site.IsMultiLingual }}
|
|
<!-- Merge home and current page translations -->
|
|
{{ $langs := dict }}
|
|
{{ range .Site.Home.AllTranslations }}
|
|
{{ $langs = merge $langs (dict .Language.Lang .) }}
|
|
{{ end }}
|
|
{{ range .Translations }}
|
|
{{ $langs = merge $langs (dict .Language.Lang .) }}
|
|
{{ end }}
|
|
|
|
<div class="book-languages">
|
|
|
|
<ul>
|
|
<li class="flex">
|
|
<img src="{{ "svg/translate.svg" | relURL }}" />
|
|
{{ $.Site.Language.LanguageName }}
|
|
</li>
|
|
</ul>
|
|
|
|
<ul class="book-languages-list">
|
|
{{ range sort $langs }}
|
|
<li class="{{ if (eq $.Site.Language .Language ) }}active{{ end }}">
|
|
<a href="{{ .Permalink }}" class="flex">
|
|
<img src="{{ "svg/translate.svg" | relURL }}" />
|
|
{{ .Language.LanguageName }}
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
|
|
</div>
|
|
{{ end }}
|