diff --git a/themes/mytheme/layouts/partials/header.html b/themes/mytheme/layouts/partials/header.html index f54c6ec..6590d11 100644 --- a/themes/mytheme/layouts/partials/header.html +++ b/themes/mytheme/layouts/partials/header.html @@ -1,3 +1,45 @@ + +{{- /* 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 }} +