Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-02-08 17:19:22 +0300
committerDillon <dillonzq@outlook.com>2020-02-08 17:19:22 +0300
commit095089fb3f05fd37e401ce407daef87224a96e0d (patch)
tree4bafaeb3aa3159bc088cc26e947fb78f26f26fb0 /layouts/_default/baseof.html
parentc5e64a9a61ed2b388ad9eaa7a8778b89959912e9 (diff)
feat(config): add config for default theme light/dark
Diffstat (limited to 'layouts/_default/baseof.html')
-rw-r--r--layouts/_default/baseof.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index c4bfea5..d8b40c6 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -16,7 +16,11 @@
<body>
{{- /* Check theme isDark before body rendering */ -}}
<script>
- window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
+ if (!window.localStorage || !window.localStorage.getItem('theme')) {
+ window.isDark = '{{ .Site.Params.defaultTheme }}' === 'dark';
+ } else {
+ window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
+ }
window.isDark && document.body.classList.add('dark-theme');
</script>