mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-12-04 00:45:20 +00:00
30 lines
955 B
HTML
30 lines
955 B
HTML
<!-- Merge home and current page translations -->
|
|
{{ $translations := dict }}
|
|
{{ range .Site.Home.AllTranslations }}
|
|
{{ $translations = merge $translations (dict .Language.Lang .) }}
|
|
{{ end }}
|
|
{{ range .Translations }}
|
|
{{ $translations = merge $translations (dict .Language.Lang .) }}
|
|
{{ end }}
|
|
|
|
<div class="book-languages" tabindex="0" aria-haspopup="true">
|
|
<ul>
|
|
<li class="flex">
|
|
<img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" />
|
|
{{ $.Site.Language.LanguageName }}
|
|
</li>
|
|
</ul>
|
|
|
|
<ul class="book-languages-list">
|
|
{{ range .Site.Languages }}{{ with index $translations .Lang }}
|
|
<li class="{{ if (eq $.Site.Language .Language) }}active{{ end }}">
|
|
<a href="{{ .RelPermalink }}" class="flex">
|
|
<img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" />
|
|
{{ .Language.LanguageName }}
|
|
</a>
|
|
</li>
|
|
{{ end }}{{ end }}
|
|
</ul>
|
|
|
|
</div>
|