update theme-switcher functionality

This commit is contained in:
somrat sorkar 2023-12-09 08:52:04 +06:00
parent 32ba8bb3fb
commit 6892f7bf94
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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>

View File

@ -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}};
@ -61,5 +60,3 @@
});
</script>
{{ end }}
{{ end }}

View File

@ -1,7 +1,7 @@
{
"name": "hugoplate",
"description": "hugo tailwindcss boilerplate",
"version": "1.9.5",
"version": "1.9.6",
"license": "MIT",
"author": "zeon.studio",
"scripts": {