selfprivacy.org/layouts/partials/navbar-lang-selector.html
2024-07-06 04:14:43 +03:00

14 lines
556 B
HTML

{{/* Link directly to documentation etc., if possible. */}}
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home }}
{{ $currentLang := .Language.Lang }}
<div class="lang-selector">
<ul class="d-flex">
{{ range $langPage.AllTranslations }}
{{ if eq $currentLang .Language.Lang }}
<li class="nav-item"><a class="nav-link active" href="{{ .RelPermalink }}">{{ .Language.Lang }}</a></li>
{{ else }}
<li class="nav-item"><a class="nav-link" href="{{ .RelPermalink }}">{{ .Language.Lang }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>