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

github.com/dataCobra/hugo-vitae.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordataCobra <datacobra@thinkbot.de>2021-07-26 17:37:48 +0300
committerdataCobra <datacobra@thinkbot.de>2021-07-26 17:37:48 +0300
commitfcf92973a9517c35534a4402103c754293e140b9 (patch)
tree29dea1600f86e17d81621c89f4055d2062d39c71
parent92a7862415d7131c623dfe23eddab5fac58b2ec6 (diff)
Add option to make dark mode default
-rw-r--r--layouts/partials/head.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index dd8539a..0694f66 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -32,6 +32,11 @@
document.addEventListener("DOMContentLoaded", function() { renderMathInElement(document.body, { delimiters: [ {left: "$$", right: "$$", display: true}, {left: "$", right: "$", display: false} ] }); });
</script>
{{- end -}}
+{{- if .Site.Params.darkmode }}
+<script>
+localStorage.setItem('theme', 'dark');
+</script>
+{{- end }}
{{- if .Site.Params.customjs.enabled }}
<script
{{ if eq .Site.Params.customjs.async true }} {{ "async" | safeHTMLAttr}}{{ end }}