mirror of https://github.com/gohugoio/hugo
17 lines
520 B
HTML
17 lines
520 B
HTML
{{- 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 }}
|