blog/layouts/shortcodes/language-switcher.html
Michael Zhang a248240a6a
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
more on induction + implement language switcher
2023-03-30 03:29:11 -05:00

28 lines
572 B
HTML

{{ $_hugo_config := `{ "version": 1 }` }}
{{ $parts := split .Inner "---" }}
{{ $page := .Page }}
<div class="tabbed">
<ul class="tabs">
{{ range $index, $snippet := $parts }}
{{ $lang := index $page.Params.language_switcher_languages $index }}
<li class="tab">
<label for="language-switcher-{{ $lang }}">{{ $lang }}</label>
</li>
{{ end }}
</ul>
<div class="contents">
{{ range $index, $snippet := $parts }}
<div class="tab-content">
{{ $snippet | markdownify }}
</div>
{{ end }}
</div>
</div>
{{/* Thank you https://codepen.io/MPDoctor/pen/mpJdYe */}}