Rename script.html to tag-script.html
This commit is contained in:
24
layouts/partials/paige/tag-script.html
Normal file
24
layouts/partials/paige/tag-script.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $defer := $params.defer | default "defer" }}
|
||||
{{ $integrity := $params.integrity }}
|
||||
{{ $onload := $params.onload | safeJS }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $type := $params.type }}
|
||||
|
||||
{{ if not $src }}
|
||||
{{ errorf "layouts/partials/paige/tag-script.html: no src" }}
|
||||
{{ end }}
|
||||
|
||||
{{ with partial "paige/resource.html" (dict "page" $page "url" $src) }}
|
||||
{{ $resource := . | minify | fingerprint }}
|
||||
{{ $integrity = $resource.Data.Integrity }}
|
||||
{{ $src = $resource.RelPermalink }}
|
||||
{{ else }}
|
||||
{{ $src = relLangURL $src }}
|
||||
{{ end }}
|
||||
|
||||
<script {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} {{ with $defer }} defer {{ end }} integrity="{{ $integrity }}" {{ with $onload }} onload="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} src="{{ $src | safeURL }}" {{ with $type }} {{ printf `type="%v"` . | safeHTMLAttr }} {{ end }}></script>
|
Reference in New Issue
Block a user