summaryrefslogtreecommitdiff
path: root/layouts/partials/head/js.html
blob: 6123e7f5175987a15e73fd41e331c6d95710248e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{- with resources.Get "js/main.js" }}
    {{- $opts := dict
        "minify" (not hugo.IsDevelopment)
        "sourceMap" (cond hugo.IsDevelopment "external" "")
        "targetPath" "js/main.js"
    }}
    {{- with . | js.Build $opts }}
        {{- if hugo.IsDevelopment }}
            <script src="{{ .RelPermalink }}"></script>
        {{- else }}
            {{- with . | fingerprint }}
                <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
            {{- end }}
        {{- end }}
    {{- end }}
{{- end }}