Last active
August 3, 2023 22:09
-
-
Save jmooring/1e4c167580ddc868abf4a8e95dcf14d5 to your computer and use it in GitHub Desktop.
Hugo - Language switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with .AllTranslations }} | |
<nav class="language-switcher"> | |
{{ range . }} | |
{{ if eq .Language.Lang $.Language.Lang }} | |
<a class="active" aria-current="page" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> | |
{{ else }} | |
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> | |
{{ end }} | |
{{ end }} | |
</nav> | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment