From 77681cca24667115630c5a0b6579119782924861 Mon Sep 17 00:00:00 2001 From: eltrac Date: Tue, 10 Feb 2026 14:39:11 +0800 Subject: chore: remove unused partials --- layouts/_partials/scripts/libra-js.html | 6 ----- layouts/_partials/scripts/toc-js.html | 41 --------------------------------- 2 files changed, 47 deletions(-) delete mode 100644 layouts/_partials/scripts/libra-js.html delete mode 100644 layouts/_partials/scripts/toc-js.html (limited to 'layouts') diff --git a/layouts/_partials/scripts/libra-js.html b/layouts/_partials/scripts/libra-js.html deleted file mode 100644 index 95e121ed..00000000 --- a/layouts/_partials/scripts/libra-js.html +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/layouts/_partials/scripts/toc-js.html b/layouts/_partials/scripts/toc-js.html deleted file mode 100644 index 110f2357..00000000 --- a/layouts/_partials/scripts/toc-js.html +++ /dev/null @@ -1,41 +0,0 @@ -{{ if .Params.toc }} - -{{ end }} -- cgit v1.2.3 From 52758459a220fde27f1519d3fd3e99f3f2a52f80 Mon Sep 17 00:00:00 2001 From: eltrac Date: Tue, 10 Feb 2026 15:39:50 +0800 Subject: feat: add theme switch --- layouts/_partials/head.html | 3 ++- layouts/_partials/head/scripts.html | 4 ++++ layouts/_partials/header/other-navigation.html | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 layouts/_partials/head/scripts.html (limited to 'layouts') diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html index a50dd333..3a8cd25c 100644 --- a/layouts/_partials/head.html +++ b/layouts/_partials/head.html @@ -4,6 +4,7 @@ {{ hugo.Generator }} {{ partial "head/siteinfo" . }} - {{ partial "head/css" . }} {{ partial "head/verification" . }} + {{ partial "head/css" . }} + {{ partial "head/scripts" . }} diff --git a/layouts/_partials/head/scripts.html b/layouts/_partials/head/scripts.html new file mode 100644 index 00000000..f067944c --- /dev/null +++ b/layouts/_partials/head/scripts.html @@ -0,0 +1,4 @@ +{{ with resources.Get "js/darkmode.js" }} + +{{ end }} + diff --git a/layouts/_partials/header/other-navigation.html b/layouts/_partials/header/other-navigation.html index 662f1076..ab6035f1 100644 --- a/layouts/_partials/header/other-navigation.html +++ b/layouts/_partials/header/other-navigation.html @@ -1,6 +1,13 @@ {{ $langButtonSize := "w-4 h-4" }}
+ + {{- $lang := .Site.Language.Lang -}} {{- $switch := dict -- cgit v1.2.3 From 044bc2ed2b2d48b8d7a2f4c53e49eba2da8ada1a Mon Sep 17 00:00:00 2001 From: eltrac Date: Tue, 10 Feb 2026 15:48:13 +0800 Subject: feat: theme switch style --- layouts/_partials/header/other-navigation.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'layouts') diff --git a/layouts/_partials/header/other-navigation.html b/layouts/_partials/header/other-navigation.html index ab6035f1..718b491c 100644 --- a/layouts/_partials/header/other-navigation.html +++ b/layouts/_partials/header/other-navigation.html @@ -2,10 +2,11 @@
- {{ $switches := slice "auto" "light" "dark" }} {{ range $switches }} - + {{ end }} @@ -16,7 +17,7 @@ {{- $entry := index $switch $lang -}} Date: Tue, 10 Feb 2026 16:00:14 +0800 Subject: fix: theme switch not showing currently selected theme - set theme select value after DOMConentLoaded - refactor: move inline `onchange` to ` + {{ $commonJS := slice (resources.Get "js/tooltip.js") -- cgit v1.2.3