diff options
Diffstat (limited to 'layouts/_partials/header')
| -rw-r--r-- | layouts/_partials/header/hoverable-logo.html | 15 | ||||
| -rw-r--r-- | layouts/_partials/header/language-switch.html | 17 | ||||
| -rw-r--r-- | layouts/_partials/header/navigation.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/header/other-navigation.html | 35 |
4 files changed, 36 insertions, 33 deletions
diff --git a/layouts/_partials/header/hoverable-logo.html b/layouts/_partials/header/hoverable-logo.html deleted file mode 100644 index d04ae6ac..00000000 --- a/layouts/_partials/header/hoverable-logo.html +++ /dev/null @@ -1,15 +0,0 @@ -<div class="group relative w-full flex flex-col items-center"> - <div class="group-hover:opacity-30 transition-opacity duration-500"> - {{ partial "components/logo" (dict "imageClass" "w-[10rem]") }} - </div> - <div class="opacity-0 group-hover:opacity-100 transition-opacity duration-500 - w-[20rem] absolute top-0 bottom-0 - flex flex-col items-center justify-center markdown-body"> - <p class="text-center text-xl font-extrabold font-italic"> - {{ T "homePageQuote.content" . | markdownify }} - </p> - <p class="w-full m-0 text-right text-sm text-secondary"> - {{ T "homePageQuote.source" . | markdownify }} - </p> - </div> -</div> diff --git a/layouts/_partials/header/language-switch.html b/layouts/_partials/header/language-switch.html deleted file mode 100644 index 9f0a9c20..00000000 --- a/layouts/_partials/header/language-switch.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ $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="rounded-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> diff --git a/layouts/_partials/header/navigation.html b/layouts/_partials/header/navigation.html index 0883206a..ec05f2a3 100644 --- a/layouts/_partials/header/navigation.html +++ b/layouts/_partials/header/navigation.html @@ -1,4 +1,4 @@ -<nav class="my-4 flex justify-center items-center w-fit rounded-4 overflow-hidden"> +<nav class="my-6 flex justify-center items-center w-fit rounded-4 overflow-hidden"> {{ range .Site.Params.nav }} <a class="inline-block py-1 px-[0.35rem] md:px-2 first:pl-3 last:pr-3 block hover:no-underline text-nowrap diff --git a/layouts/_partials/header/other-navigation.html b/layouts/_partials/header/other-navigation.html new file mode 100644 index 00000000..c40860c1 --- /dev/null +++ b/layouts/_partials/header/other-navigation.html @@ -0,0 +1,35 @@ +{{ $langButtonSize := "w-4 h-4" }} + +<div class="flex gap-2 pr-2"> + {{ if eq .Site.Language.Lang "zh" }} + <!-- insight (/stats) page link --> + <a + href="/stats" + class="rounded-full text-center hover:no-underline {{ $langButtonSize }} + bg-neutral/10 border-1 border-[var(--text-color)] border-solid + bg-[var(--block-background-color)] + items-center justify-center + hidden md:flex" + title="洞察" + > + <span class="text-size-[0.5rem] font-extrabold">i</span> + </a> + {{ end }} + + <!-- 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="rounded-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> |
