Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/darshanbaral/aafu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Baral <darshanbaral@gmail.com>2020-01-14 03:15:46 +0300
committerDarshan Baral <darshanbaral@gmail.com>2020-01-14 03:15:46 +0300
commit640d7913d40cf6826b33fee59390c8b8ef927a48 (patch)
treed93b6ee850c363cdff2e8f77af9f2075815aca6a
parent6f56ec8ed401bc79c3e83897eb63f4db9864df15 (diff)
Theme toggler is in menu now
-rw-r--r--layouts/partials/header.html11
-rw-r--r--layouts/partials/toggleTheme.html15
2 files changed, 17 insertions, 9 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..83361bd
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,11 @@
+<div class="d-flex flex-row justify-content-between align-items-center mt-2">
+<div class="d-flex flex-row row">
+ <h3 class="main-menu mr-3">
+ <a href="{{ .Site.BaseURL }}">Home</a>
+ </h3>
+ <h3 class="main-menu mr-3">
+ <a href="{{ "blog" | relURL }}">Blog</a>
+ </h3>
+</div>
+{{ partial "toggleTheme" . }}
+</div> \ No newline at end of file
diff --git a/layouts/partials/toggleTheme.html b/layouts/partials/toggleTheme.html
index f71cfee..eb437c2 100644
--- a/layouts/partials/toggleTheme.html
+++ b/layouts/partials/toggleTheme.html
@@ -9,21 +9,18 @@
</div>
<script>
- const mainTheme =
- "{{ print (`/css/aafu_` | relURL) .Site.Params.theme.mainTheme `.css` }}";
- const altTheme =
- "{{ print (`/css/aafu_` | relURL) .Site.Params.theme.altTheme `.css` }}";
+ //const mainTheme =
+ // "{{ print (`/css/aafu_` | relURL) .Site.Params.theme.mainTheme `.css` }}";
+ //const altTheme =
+ // "{{ 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);
- } else {
- currentCSS.setAttribute("href", "." + mainTheme);
- }
+ currentTheme = currentTheme === mainTheme ? altTheme : mainTheme;
+ foo(currentTheme);
}
function changeThemeColor() {