blog.hugopoi.net/v2/layouts/partials/language-switcher.html

18 lines
478 B
HTML
Raw Normal View History

{{ if .Site.IsMultiLingual }}
<nav class="language-selector">
<ul>
{{ range .Site.Languages }}
{{ if eq . $.Site.Language }}
<li><span title="{{ .LanguageName }}">{{ .Params.languageFlag }}</span></li>
{{ end }}
{{ end }}
{{ range .Translations }}
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}" title="{{ .Language.LanguageName }}">{{ .Language.Params.languageFlag }}</a></li>
{{ end -}}
</ul>
</nav>
{{ end }}