js.html 520 B

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