summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-07-20 20:41:19 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-07-20 20:43:23 +0530
commit338027b046f7f72a8fe9c52e8ca7adeddf261868 (patch)
treee95e44c28dafbeeecc760d00783f03fc4e9c9f9b
parent8a0783adfb8399cbde4b42782dfc182d9bf54aed (diff)
SetThemeAuto: disable auto theme set by default
- user needs to add + params: SetThemeAuto: true
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/partials/head.html4
2 files changed, 5 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 4035dd6..e243b57 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -6,9 +6,11 @@
</head>
<body class="{{ if eq .Kind `page` }}single{{ else }}list{{ if .IsHome }} home{{ end }}{{ end }}">
+ {{- if $.Site.Params.SetThemeAuto -}}
<script>
setTheme();
</script>
+ {{- end -}}
<header class="header">
{{- partial "header.html" . }}
</header>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 91687be..4b03bd0 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -32,5 +32,7 @@
{{- template "_internal/opengraph.html" . }}
{{- end }}
<!-- Script -->
+{{- if $.Site.Params.SetThemeAuto -}}
{{ $settheme := resources.Get "set-theme.js" | minify }}
-<script src="{{ $settheme.Permalink }}"></script> \ No newline at end of file
+<script src="{{ $settheme.Permalink }}"></script>
+{{- end -}} \ No newline at end of file