hugo-stanley/layouts/partials/custom-js.html
2020-03-03 18:56:59 +01:00

19 lines
664 B
HTML

{{- $js := "" -}}
{{- range site.Params.assets.js -}}
{{- $customJS := resources.Get . -}}
{{- if $customJS -}}
{{- if eq $js "" -}}
{{- $js = $customJS -}}
{{- else -}}
{{- $js = slice $js $customJS | resources.Concat (printf "%s.tmp_custom.js" .) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if ne $js "" -}}
{{- $coreJS := slice $js ("" | resources.FromString "js/_core.js") | resources.Concat "js/core.js" -}}
{{- $coreJS = $coreJS | resources.Minify | resources.Fingerprint "sha384" -}}
<script src="{{- $coreJS.RelPermalink -}}" integrity="{{- $coreJS.Data.Integrity -}}"></script>
{{- end -}}
{{- partial "js.html" . -}}