Head: Include all JavaScript sources in js directory

Co-authored-by: c6ristian <c6ristian@christian.moe>
This commit is contained in:
June 2023-10-31 00:11:46 +01:00 committed by jtbx
parent 4f4d2c0fc6
commit b1c697228c

View file

@ -1,4 +1,5 @@
{{- $options := dict "transpiler" "libsass" "targetPath" "css/style.css" -}} {{- $options := dict "transpiler" "libsass" "targetPath" "css/style.css" -}}
{{- $jsResources := resources.Match "js/*.js" }}
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8"> <meta charset="utf-8">
@ -10,9 +11,11 @@
{{- end }} {{- end }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}thirdparty/fontawesome6/css/all.min.css" crossorigin="anonymous"> <link rel="stylesheet" href="{{ .Site.BaseURL }}thirdparty/fontawesome6/css/all.min.css" crossorigin="anonymous">
{{ with resources.Get "js/roomstate.js" | js.Build | minify | fingerprint -}} {{- range $jsResources }}
{{- with . | js.Build | minify | fingerprint }}
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script> <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{- end }} {{- end }}
{{- end }}
{{ range .AlternativeOutputFormats -}} {{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}