From 4629494c03a0cdf7028644a54b61b71a047ad36b Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Wed, 13 Mar 2024 16:42:54 +0800 Subject: [PATCH] rename "style" to "colorTheme", add "colorThemeSwitcher" --- layouts/partials/head.html | 8 +- layouts/partials/theme-switcher.html | 107 ++++++++++++++------------- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c4c6ab0..b0c0768 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -21,12 +21,12 @@ {{ partial "favicons.html" . }} -{{ $style := "light-without-switcher" }} -{{ if and (isset site.Params "style") (ne site.Params.style "") }} - {{ $style = site.Params.style | lower }} +{{ $colorTheme := "light-without-switcher" }} +{{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} + {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} -{{ if not (in (slice "light-without-switcher" "dark-without-switcher") $style) }} +{{ if not (in (slice "light-without-switcher" "dark-without-switcher") $colorTheme) }}