hugo-theme-anubis2/layouts/partials/post-language-switcher.html
2024-04-09 20:03:09 +08:00

19 lines
544 B
HTML

{{ if .IsTranslated }}
{{ $pageLang := .Page.Lang}}
<span>
<ul class="post-translations">
{{ range (sort .AllTranslations ".Lang" "asc" ) }}
{{ if eq .Lang $pageLang }}
<li>
{{ upper .Lang }}
</li>
{{ else }}
<li>
<a href="{{ .RelPermalink }}">{{ upper .Lang }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</span>
{{ end }}