aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/languages.html
blob: 1666215d76cb56f5668a36ae01429578f21df2ca (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
30
<!-- 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 }}" 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 }}" alt="Languages" />
        {{ .Language.LanguageName }}
      </a>
    </li>
    {{ end }}
  </ul>

</div>