diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-05 14:33:48 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-05 14:34:44 +0530 |
| commit | a9e00a3640b5d98e6fce03dc5c67e87e3fac916d (patch) | |
| tree | 2ebd32d7d9c35a4f98691a99fb36eac0906be0a4 /layouts/partials/footer.html | |
| parent | 994c0b56e198f48c20f7780d4e6e52adf4baa153 (diff) | |
theme: set proper conditions
for having default-theme with theme-toggle
* can set/unset default theme
* for default-theme: dark/light : theme-toggle will not be visible
* theme-toggle with defaultheme: auto is functional
fixes #25 for #15
Diffstat (limited to 'layouts/partials/footer.html')
| -rw-r--r-- | layouts/partials/footer.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d7e9166..1c28f3a 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -49,7 +49,7 @@ localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft); } </script> -{{- if not .Site.Params.disableThemeToggle }} +{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }} <script> document.getElementById("theme-toggle").addEventListener("click", () => { if (document.body.className.includes("dark")) { @@ -66,4 +66,4 @@ <script> localStorage.removeItem("pref-theme"); </script> -{{- end }} +{{- end }}
\ No newline at end of file |
