Files
hextra_mirror/layouts/_partials/scripts/core.html
Ludovic Fernandez 1c06ae5580 chore(scripts): generic way to build scripts (#829)
* chore: move core scripts

* chore: extract head scripts
2025-09-11 20:29:18 +01:00

11 lines
431 B
HTML

{{- $scriptsBody := slice }}
{{- range resources.Match "js/core/*.js" -}}
{{ $scriptsBody = $scriptsBody | append (resources.ExecuteAsTemplate .Name $ .) }}
{{- end -}}
{{- $scripts := $scriptsBody | resources.Concat "js/main.js" -}}
{{- if hugo.IsProduction -}}
{{- $scripts = $scripts | minify | fingerprint -}}
{{- end -}}
<script defer src="{{ $scripts.RelPermalink }}" integrity="{{ $scripts.Data.Integrity }}"></script>