From 3064e8cfc5fa7e41e80ecdcd57f80276391c4a15 Mon Sep 17 00:00:00 2001 From: Itay Cohen Date: Wed, 4 Nov 2020 10:34:45 +0200 Subject: theme-switch: Enable theme toggle unless specifically disabled (#69) Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> --- layouts/partials/header.html | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'layouts/partials/header.html') diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 233587b..0a433b9 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,21 +1,32 @@ -{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }} +{{- if (eq .Site.Params.defaultTheme "light") }} -{{- end }} -{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }} +{{- else if (eq .Site.Params.defaultTheme "dark") }} +{{- else if (or (eq .Site.Params.defaultTheme "auto") (not .Site.Params.disableThemeToggle) ) }} +