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

js.html « head « partials « layouts - github.com/negrel/hugo-theme-pico.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e034de724a108d5df846cdcf878b682e21f024b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{/* Google Analytics */}}
{{ template "_internal/google_analytics.html" . }}

{{ $js_bundle := slice }}
{{ range site.Params.customJS }}
{{ $script := resources.Get . }}
{{ $js_bundle = $js_bundle | append $script }}
{{ end }}

{{/* Default option for dark mode is to use the browser theme */}}
{{ if eq (isset .Site.Params "darkmode") false }}
{{ $js_bundle = $js_bundle | append (resources.Get "js/dark-mode.js") }}
{{ end }}

{{ if gt (len $js_bundle) 0 }}

{{ $js_bundle = $js_bundle | resources.Concat "js/pico.min.js" | fingerprint "md5" }}
<script src="{{ $js_bundle.Permalink }}" intergrity="{{ $js_bundle.Data.Integrity }}" crossorigin="anonymous"></script>

{{ end }}