create/skeletons/theme/layouts/_partials/head/js.html
raw| 1 | {{- with resources.Get "js/main.js" }} |
| 2 | {{- $opts := dict |
| 3 | "minify" (cond hugo.IsDevelopment false true) |
| 4 | "sourceMap" (cond hugo.IsDevelopment "linked" "none") |
| 5 | }} |
| 6 | {{- with . | js.Build $opts }} |
| 7 | {{- if hugo.IsDevelopment }} |
| 8 | <script src="{{ .RelPermalink }}"></script> |
| 9 | {{- else }} |
| 10 | {{- with . | fingerprint }} |
| 11 | <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script> |
| 12 | {{- end }} |
| 13 | {{- end }} |
| 14 | {{- end }} |
| 15 | {{- end }} |