aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/languages.html
blob: 63404a9e0c5d56458cc0f0e7533a5306a9bc31da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!-- 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" 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 sort $langs }}
    <li class="{{ if (eq $.Site.Language .Language) }}active{{ end }}">
      <a href="{{ .Permalink }}" class="flex">
        <img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" />
        {{ .Language.LanguageName }}
      </a>
    </li>
    {{ end }}
  </ul>

</div>