blob: 0210efa8b427dd3538a8fd4e41ba2fda08cc8132 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
{{- with resources.Get "js/main.js" }}
{{- $opts := dict
"minify" (cond hugo.IsDevelopment false true)
"sourceMap" (cond hugo.IsDevelopment "linked" "none")
}}
{{- 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 }}
|