From 6ddf3af7b143473e5c41a100ab146fef80dd453f Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Thu, 21 May 2020 11:48:12 +0000
Subject: [PATCH] Proposal for dark theme

---
 layouts/partials/footer.html |   28 ++--------------------------
 1 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 64dce74..36b2a41 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -6,36 +6,12 @@
 <script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
 {{ $migrate := resources.Get "js/jquery-migrate.js" }}
 {{ $appear := resources.Get "js/jquery-appear.js" }}
-{{ $js := slice $migrate $appear | resources.Concat "js/bundle.js" }}
+{{ $anatole := resources.Get "js/anatole.js" }}
+{{ $js := slice $migrate $appear $anatole | resources.Concat "js/bundle.js" }}
 {{ $secureJS := $js |  resources.Minify | resources.Fingerprint }}
 <script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
 {{- partial "medium-zoom.html" . -}}
 {{- partial "math.html" . -}}
 {{- template "_internal/google_analytics_async.html" . -}}
 
-<script type="text/javascript" >
-const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
-
-function switchTheme(e) {
-    if (e.target.checked) {
-        document.documentElement.setAttribute('data-theme', 'dark');
-        localStorage.setItem('theme', 'dark');
-    }
-    else {
-        document.documentElement.setAttribute('data-theme', 'light');
-        localStorage.setItem('theme', 'light');
-    }    
-}
-
-toggleSwitch.addEventListener('change', switchTheme, false);
-const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
-
-if (currentTheme) {
-    document.documentElement.setAttribute('data-theme', currentTheme);
-
-    if (currentTheme === 'dark') {
-        toggleSwitch.checked = true;
-    }
-}
-</script>
 </html>
\ No newline at end of file

--
Gitblit v1.10.0