From 50074cc1cc56bfa7c6a87ed0e6f7c5a2d9c1847f Mon Sep 17 00:00:00 2001 From: gribse Date: Sun, 27 Apr 2025 22:41:29 +0200 Subject: [PATCH] add header and menu partials with theme toggle functionality --- layouts/partials/header.html | 125 +++++++++++++++++++++++++++++++++++ layouts/partials/menu.html | 37 +++++++++++ 2 files changed, 162 insertions(+) create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/menu.html diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..58ecb86 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,125 @@ +{{- /* 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 }} + +
+ +
diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..4cce17d --- /dev/null +++ b/layouts/partials/menu.html @@ -0,0 +1,37 @@ + + \ No newline at end of file