chill_hugoplate/layouts/partials/essentials/script.html

38 lines
915 B
HTML
Raw Normal View History

2023-05-25 10:41:54 +00:00
<!-- JS Plugins + Main script -->
{{ $scripts := slice }}
{{ range site.Params.plugins.js }}
{{ if findRE "^http" .link }}
<script
src="{{ .link | relURL }}"
type="application/javascript"
{{ .attributes | safeHTMLAttr }}></script>
{{ else }}
{{ $scripts = $scripts | append (resources.Get .link) }}
{{ end }}
{{ end }}
<!-- main script -->
{{ $scripts = $scripts | append (resources.Get "js/main.js") }}
{{ $scripts = $scripts | resources.Concat "js/script.js" }}
{{ if hugo.IsProduction }}
{{ $scripts = $scripts | minify | fingerprint }}
{{ end }}
<script
crossorigin="anonymous"
integrity="{{ $scripts.Data.Integrity }}"
src="{{ $scripts.RelPermalink }}"></script>
<!-- progressive web app -->
{{ partialCached "pwa.html" . }}
<!-- cookie consent -->
{{ partialCached "cookie-consent.html" . }}
<!-- google adsense -->
{{ partialCached "adsense-script.html" . }}