From 47a2fc815386d762d9e61376dce36c983787e093 Mon Sep 17 00:00:00 2001 From: Reorx Date: Fri, 27 May 2022 22:40:21 +0800 Subject: refactor theme toggle; add delegate-it --- layouts/partials/header.html | 82 +++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 32 deletions(-) (limited to 'layouts/partials/header.html') diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f708cb7..166eee1 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,43 +1,61 @@ -{{- /* theme-toggle is enabled */}} -{{- if (not site.Params.disableThemeToggle) }} -{{- /* theme is light */}} -{{- if (eq site.Params.defaultTheme "light") }} - -{{- /* theme is dark */}} -{{- else if (eq site.Params.defaultTheme "dark") }} - -{{- else }} -{{- /* theme is auto */}} - -{{- end }} -{{- /* theme-toggle is disabled and theme is auto */}} -{{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}} -{{- end }}