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/footer.html | 35 +++++++++++-------- layouts/partials/header.html | 82 +++++++++++++++++++++++++++----------------- 2 files changed, 71 insertions(+), 46 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 67355d0..a38931d 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -26,6 +26,27 @@ {{- partial "extend_footer.html" . }} +{{/* Load delegate script */}} +{{- $delegate := resources.Get "js/delegate-it.js" }} + + + + {{- end }} -{{- if (not site.Params.disableThemeToggle) }} - -{{- end }} - {{- /* Base64Email */}} {{- if (.Param "MaskedEmail") }} -{{- /* 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 }}