From 0eed773e6dcf999cb052b6f781bfbe7ad74e63c7 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Tue, 3 Nov 2020 20:05:21 +0530
Subject: theme-switch-button: improve logic
- owner can set dark/light/auto default theme
- theme toggle will be enabled on all theme modes unless disbaled
- if disableThemeToggle is true, user won't be able to switch themes,
here auto (a/c to system theme) also works
for #69
---
layouts/partials/header.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'layouts/partials/header.html')
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 233587b..2dc56a6 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,4 +1,4 @@
-{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }}
+{{- if (and (not .Site.Params.disableThemeToggle) (not (eq .Site.Params.defaultTheme "auto"))) }}
{{- end }}
-{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }}
+{{- if (eq .Site.Params.defaultTheme "auto") }}