aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/languages.html
blob: 543cdff65ddbc7b9b1c25d6523ef652614f94c03 (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 }}" />
      {{ $.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>