aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/languages.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/docs/languages.html')
-rw-r--r--layouts/partials/docs/languages.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/layouts/partials/docs/languages.html b/layouts/partials/docs/languages.html
new file mode 100644
index 0000000..d905327
--- /dev/null
+++ b/layouts/partials/docs/languages.html
@@ -0,0 +1,32 @@
+{{ 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 }}