Files
paige-hugo/layouts/partials/paige/script.html
2022-12-31 17:11:15 -08:00

12 lines
490 B
HTML

{{ $path := false }}
{{ $src := .src }}
{{ if eq $src (urls.Parse $src).Path }}
{{ $path = true }}
{{ with resources.Get (relLangURL $src) }}
{{ $src = (. | minify | fingerprint).RelPermalink }}
{{ else }}
{{ $src = relLangURL $src }}
{{ end }}
{{ end }}
<script{{ if not $path }} crossorigin="anonymous"{{ end }} defer integrity="{{ .integrity }}"{{ with .onload }} onload="{{ . | safeJS }}"{{ end }} referrerpolicy="no-referrer" src="{{ $src }}"></script>