rename "style" to "colorTheme", add "colorThemeSwitcher"

This commit is contained in:
Junyi Hou 2024-03-13 16:42:54 +08:00
parent 9e2a23e83b
commit 4629494c03
2 changed files with 58 additions and 57 deletions

View file

@ -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) }}
<style>
body {
visibility: hidden;