summaryrefslogtreecommitdiff
path: root/layouts/_partials/header/other-navigation.html
blob: db37477d8365e5f11d9d83ab3a8d5ae1320013e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{{ $langButtonSize := "w-4 h-4" }}

<div class="flex gap-2 pr-2">
    <!-- theme switch -->
    <select id="theme-select"
        class="bg-neutral/10 border-1 border-[var(--text-color)] border-solid rd text-[var(--text-color)] font-serif text-size-[0.5rem] font-extrabold">
    {{ $switches := slice "auto" "light" "dark" }}
    {{ range $switches }}
        <option value="{{ . }}">{{ T (printf "theme.%s" .) }}</option>
    {{ end }}
    </select>
    <!-- language switch -->
    {{- $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>
</div>