update theme-switcher functionality
This commit is contained in:
parent
32ba8bb3fb
commit
6892f7bf94
@ -1,7 +1,7 @@
|
||||
#################### default parameters ################################
|
||||
# favicon
|
||||
# favicon module: https://github.com/gethugothemes/hugo-modules/tree/master/images#favicon-implementation
|
||||
favicon = "images/favicon.png"
|
||||
# logo
|
||||
# logo module: https://github.com/gethugothemes/hugo-modules/tree/master/images#logo-implementation
|
||||
logo = "images/logo.png"
|
||||
logo_darkmode = "images/logo-darkmode.png"
|
||||
# use `px` or `x` with logo_width, example: "100px".
|
||||
@ -16,7 +16,7 @@ logo_text = "Hugoplate"
|
||||
navbar_fixed = true
|
||||
# theme-mode
|
||||
theme_switcher = true
|
||||
theme_default = "dark" # available options [light/dark/system]
|
||||
theme_default = "system" # available options [light/dark/system]
|
||||
# Main Sections
|
||||
mainSections = ["blog"]
|
||||
# contact form action
|
||||
|
@ -1,6 +1,9 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
itemscope
|
||||
class="{{- if not site.Params.theme_switcher -}}
|
||||
{{- site.Params.theme_default -}}
|
||||
{{- end -}}"
|
||||
lang="{{ site.LanguageCode | default `en-US` }}"
|
||||
itemtype="http://schema.org/WebPage">
|
||||
<head>
|
||||
|
@ -34,7 +34,6 @@
|
||||
</div>
|
||||
|
||||
<!-- theme switcher -->
|
||||
{{ if site.Params.theme_switcher }}
|
||||
<script>
|
||||
var darkMode = {{if eq site.Params.theme_default "dark"}}true{{else}}false{{end}};
|
||||
|
||||
@ -60,6 +59,4 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "hugoplate",
|
||||
"description": "hugo tailwindcss boilerplate",
|
||||
"version": "1.9.5",
|
||||
"version": "1.9.6",
|
||||
"license": "MIT",
|
||||
"author": "zeon.studio",
|
||||
"scripts": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user