SetThemeAuto: disable auto theme set by default

- user needs to add
        + params:
             SetThemeAuto: true
This commit is contained in:
Aditya Telange 2020-07-20 20:41:19 +05:30
parent 8a0783adfb
commit 338027b046
2 changed files with 5 additions and 1 deletions

View File

@ -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>

View File

@ -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>
<script src="{{ $settheme.Permalink }}"></script>
{{- end -}}