diff options
author | Darshan Baral <darshanbaral@gmail.com> | 2019-07-21 00:58:45 +0300 |
---|---|---|
committer | Darshan Baral <darshanbaral@gmail.com> | 2019-07-21 00:58:45 +0300 |
commit | 39a480d068b05ad2fa8ed62ba49a085d59be151f (patch) | |
tree | 79f64370ae906e6f41d9ce0cb551d5b2e6faa892 | |
parent | 7a14f4e0eb4d001f2e11fdc0914a9f74ef311f01 (diff) |
Add period before CSS filepath
-rw-r--r-- | layouts/partials/toggleTheme.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/layouts/partials/toggleTheme.html b/layouts/partials/toggleTheme.html index 912c9d7..f71cfee 100644 --- a/layouts/partials/toggleTheme.html +++ b/layouts/partials/toggleTheme.html @@ -10,17 +10,19 @@ <script> const mainTheme = - "{{ print `/css/aafu_` .Site.Params.theme.mainTheme `.css` | absURL }}"; + "{{ print (`/css/aafu_` | relURL) .Site.Params.theme.mainTheme `.css` }}"; const altTheme = - "{{ print `/css/aafu_` .Site.Params.theme.altTheme `.css` | absURL }}"; + "{{ print (`/css/aafu_` | relURL) .Site.Params.theme.altTheme `.css` }}"; const currentCSS = document.querySelector("#color-CSS"); function toggleTheme(elem) { + //console.log("." + mainTheme); + //console.log(altTheme); elem.classList.toggle("fa-toggle-off"); elem.classList.toggle("fa-toggle-on"); if (currentCSS.href.includes(mainTheme)) { - currentCSS.setAttribute("href", altTheme); + currentCSS.setAttribute("href", "." + altTheme); } else { - currentCSS.setAttribute("href", mainTheme); + currentCSS.setAttribute("href", "." + mainTheme); } } |