From e7a93e2088f451713ec7e86be911023b32f3eb8d Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Fri, 26 Apr 2024 12:37:08 +0800 Subject: [PATCH] update: "colorThemeSwitcher" defaults to "true" --- layouts/partials/head.html | 6 ++++-- layouts/partials/theme-switcher.html | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f3d038e..ea2de2b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -22,14 +22,16 @@ {{ partial "favicons.html" . }} {{ $colorTheme := "light" }} -{{ $colorThemeSwitcher := false }} +{{ $colorThemeSwitcher := true }} {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} -{{ if and (isset site.Params "colorthemeswitcher") }} +{{ if isset site.Params "colorthemeswitcher" }} {{ $colorThemeSwitcher = site.Params.colorthemeswitcher }} +{{ else }} + {{ $colorThemeSwitcher = true }} {{ end }} {{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }} diff --git a/layouts/partials/theme-switcher.html b/layouts/partials/theme-switcher.html index 647e053..73cf4ab 100644 --- a/layouts/partials/theme-switcher.html +++ b/layouts/partials/theme-switcher.html @@ -1,16 +1,16 @@ {{ $colorTheme := "light" }} -{{ $colorThemeSwitcher := false }} +{{ $colorThemeSwitcher := true }} {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} -{{ if and (isset site.Params "colorthemeswitcher") }} +{{ if isset site.Params "colorthemeswitcher" }} {{ $colorThemeSwitcher = site.Params.colorthemeswitcher }} {{ end }} {{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }} - {{ if site.Params.colorthemeswitcher }} + {{ if $colorThemeSwitcher }}
{{ partial "font-awesome.html" (dict "iconName" "theme-light" "custom" false) }}