summaryrefslogtreecommitdiff
path: root/layouts/_partials/header/lang-switch.html
blob: 252baee3ff9682b7e50b6a77f47a9e7fb9a00893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $langButtonSize := "w-4 h-4" }}

{{- $lang := .Site.Language.Lang -}}
{{- $switch := dict
  "en" (dict "url" "/zh/" "label" "ZH" "title" "查看中文博客")
  "zh" (dict "url" "/en/" "label" "EN" "title" "View English Blog") -}}
{{- $entry := index $switch $lang -}}
<a
    href="{{ $entry.url }}"
    class="rd-full text-center hover:no-underline {{ $langButtonSize }}
      bg-neutral/10 border-1 border-[var(--text-color)] border-solid
      bg-[var(--block-background-color)]
      flex items-center justify-center"
    title="{{ $entry.title }}"
>
  <span class="text-size-[0.5rem] font-extrabold">{{ $entry.label }}</span>
</a>