{{ $crossorigin := .crossorigin }}
{{ $defer := .defer | default "defer" }}
{{ $onload := .onload | safeJS }}
{{ $page := .page }}
{{ $referrerpolicy := .referrerpolicy | default "no-referrer" }}
{{ $src := .src }}

{{ $resource := (partial `paige/func-resource.html` (dict
    "page" $page
    "url" $src
)) | minify | fingerprint }}

{{ $integrity := $resource.Data.Integrity }}
{{ $src = $resource.RelPermalink }}

<script {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} {{ with $defer }} defer {{ end }} integrity="{{ $integrity }}" {{ with $onload }} onload="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} src="{{ $src }}"></script>
