Skip to content

Commit

Permalink
stay on current page when switching languages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Stierl committed Apr 13, 2020
1 parent 611a7ea commit 28e7651
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions layouts/partials/fragments/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,10 @@
</div>
{{- end }}
{{- if .Site.IsMultiLingual -}}
{{- range .Site.Languages }}
{{- if ne .Lang $.Site.Language.Lang -}}
<a class="btn btn-secondary mr-1 my-2" href="{{ delimit (slice "/" .) "" }}" role="button">
{{ .LanguageName }}
</a>
{{- end -}}
{{- range $.root.Page.Translations }}
<a class="btn btn-secondary mr-1 my-2" href="{{ .Permalink }}" role="button">
{{ .Language.LanguageName }}
</a>
{{- end -}}
{{- end }}
</div>
Expand Down

0 comments on commit 28e7651

Please sign in to comment.