From c550cc45d5bcb8ea3037b5c2b1b045483cc30f01 Mon Sep 17 00:00:00 2001 From: Morgan Date: Sun, 29 Oct 2023 16:25:46 +0900 Subject: [PATCH] Update themes/mytheme/layouts/partials/head.html --- themes/mytheme/layouts/partials/head.html | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/themes/mytheme/layouts/partials/head.html b/themes/mytheme/layouts/partials/head.html index 86ab33b..91a46be 100644 --- a/themes/mytheme/layouts/partials/head.html +++ b/themes/mytheme/layouts/partials/head.html @@ -185,3 +185,44 @@ {{- template "partials/templates/twitter_cards.html" . }} {{- template "partials/templates/schema_json.html" . }} {{- end -}} + +{{- /* 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 }} \ No newline at end of file