Skip to content

Commit

Permalink
nav partial: properly link multilingual translation to the permalink (#…
Browse files Browse the repository at this point in the history
…465)

Co-authored-by: Alexandra Zaharia <alexandra.zaharia@platform.sh>
  • Loading branch information
alexandra-zaharia and Alexandra Zaharia authored Jun 19, 2023
1 parent 3c55b34 commit fb15b8e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
<li class="navlinks-container">
<a class="navlinks-parent">{{ i18n "languageSwitcherLabel" }}</a>
<div class="navlinks-children">
{{ range .Site.Languages }}
{{ range .Translations }}
{{ if not (eq .Lang $.Site.Language.Lang) }}
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
<a href="{{ .Permalink }}">{{ default .Lang .Site.Language.LanguageName }}</a>
{{ end }}
{{ end }}
</div>
</li>
{{ else }}
<li>
{{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }}
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }}
{{ if .IsTranslated }}
{{ range .Translations }}
<a href="{{ .Permalink }}">{{ default .Lang .Site.Language.LanguageName }}</a>
{{ end}}
{{ end }}
</li>
{{ end }}
Expand Down

0 comments on commit fb15b8e

Please sign in to comment.