From 4bd6cadc3bae65b989b6dc10335d504bb8d6341f Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Wed, 13 Mar 2024 16:59:22 +0800 Subject: [PATCH] finished moving "style" to "colorTheme, colorThemeSwitcher" --- layouts/partials/head.html | 10 ++++++++-- layouts/partials/theme-switcher.html | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b0c0768..a902d73 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -21,12 +21,18 @@ {{ partial "favicons.html" . }} -{{ $colorTheme := "light-without-switcher" }} +{{ $colorTheme := "light" }} +{{ $colorThemeSwitcher := false }} + {{ 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") $colorTheme) }} +{{ if and (isset site.Params "colorthemeswitcher") }} + {{ $colorThemeSwitcher = site.Params.colorthemeswitcher }} +{{ end }} + +{{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }}