aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--layouts/partials/nav.html4
-rw-r--r--layouts/partials/themeSwitcher.html6
2 files changed, 5 insertions, 5 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 9a63b34..a86bd73 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -14,12 +14,12 @@
{{- end -}}
{{- $url := urls.Parse .URL -}}
{{- $baseurl := urls.Parse $.Site.Params.Baseurl -}}
- <li class="nav-menu-margins-left-and-right{{if $active }} nav-menu-active{{end}}">
+ <li{{if $active }} class="nav-menu-active"{{end}}>
<a href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"{{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ .Name }}</a>
</li>
{{ end }}
<li>
- <select id="themes" class="nav-menu-magin-left" onchange="setTheme()">
+ <select id="themes" onchange="setTheme()">
<option value="black-theme">Black</option>
<option value="dark-theme">Dark</option>
<option value="light-theme">Light</option>
diff --git a/layouts/partials/themeSwitcher.html b/layouts/partials/themeSwitcher.html
index 902d8e3..9781878 100644
--- a/layouts/partials/themeSwitcher.html
+++ b/layouts/partials/themeSwitcher.html
@@ -1,15 +1,15 @@
<script>
function setTheme() {
const themeName = document.getElementById('themes').value;
- localStorage.setItem('theme', themeName);
document.documentElement.className = themeName;
+ localStorage.setItem('theme', themeName);
}
(function () { // Set the theme on page load
+ const elt = document.getElementById('themes');
+ elt.style.display = 'block';
const themeName = localStorage.getItem('theme');
if (themeName) {
document.documentElement.className = themeName;
- const elt = document.getElementById('themes');
- elt.style.display = "block";
elt.value = themeName;
}
})();