diff options
author | Oscar Najera <hi@oscarnajera.com> | 2024-12-28 06:29:35 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2024-12-28 06:29:35 +0100 |
commit | bde1d091d62f18c8e62731fab5f1ebcebdb246a9 (patch) | |
tree | 071a470696a1247ee3bd3e9f9fd9079fa0997488 | |
parent | cb1d03ea430c4afd3175d740d79832ddde469577 (diff) | |
download | hugo-minimalist-theme-bde1d091d62f18c8e62731fab5f1ebcebdb246a9.tar.gz hugo-minimalist-theme-bde1d091d62f18c8e62731fab5f1ebcebdb246a9.tar.bz2 hugo-minimalist-theme-bde1d091d62f18c8e62731fab5f1ebcebdb246a9.zip |
language switcher
-rw-r--r-- | layouts/partials/header.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8613478..5048eea 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -31,6 +31,23 @@ </a> </li> {{ end }} + + {{ if .IsTranslated }} + <select + name="lang" + class="mv2 pv1 tc ba b--black-20 br2 w3-theme-d3 mw3 " + onchange="self.location=options[selectedIndex].value" + > + <option value="{{ .Permalink }}"> + {{ .Language.Lang }} + </option> + {{ range .Translations }} + <option value="{{ .Permalink }}"> + {{ .Language.Lang }} + </option> + {{ end }} + </select> + {{ end }} </ul> </div> </nav> |