update: "colorThemeSwitcher" defaults to "true"

This commit is contained in:
Junyi Hou 2024-04-26 12:37:08 +08:00
parent 87172dbdfc
commit e7a93e2088
2 changed files with 7 additions and 5 deletions

View File

@ -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") }}

View File

@ -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 }}
<div class="theme-switcher">
{{ partial "font-awesome.html" (dict "iconName" "theme-light" "custom" false) }}
</div>