From a9e00a3640b5d98e6fce03dc5c67e87e3fac916d Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Mon, 5 Oct 2020 14:33:48 +0530 Subject: theme: set proper conditions for having default-theme with theme-toggle * can set/unset default theme * for default-theme: dark/light : theme-toggle will not be visible * theme-toggle with defaultheme: auto is functional fixes #25 for #15 --- layouts/partials/header.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'layouts/partials/header.html') diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f67f33b..40e7b15 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,4 +1,4 @@ -{{- if eq .Site.Params.defaultTheme "auto" }} +{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }} {{- end }} +{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }} + +{{- end }}