rename "style" to "colorTheme", add "colorThemeSwitcher"
This commit is contained in:
parent
9e2a23e83b
commit
4629494c03
@ -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;
|
||||
|
@ -1,10 +1,11 @@
|
||||
{{ $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 ne "auto-without-switcher" $style }}
|
||||
{{ if not (in (slice "light-without-switcher" "dark-without-switcher") $colorTheme) }}
|
||||
{{ if site.Params.colorthemeswitcher }}
|
||||
<div class="theme-switcher">
|
||||
{{ partial "font-awesome.html" (dict "iconName" "theme-light" "custom" false) }}
|
||||
</div>
|
||||
@ -12,7 +13,7 @@
|
||||
|
||||
<script>
|
||||
const STORAGE_KEY = 'user-color-scheme'
|
||||
const defaultTheme = {{ $style }}
|
||||
const defaultTheme = {{ $colorTheme }}
|
||||
|
||||
let currentTheme
|
||||
let switchButton
|
||||
|
Loading…
Reference in New Issue
Block a user