Remove the SRI stuff; use md5 instead of sha512 for fingerprinting since it is shorter

This commit is contained in:
Eryn Wells 2022-11-12 07:49:33 -08:00
parent fb1b4ccab3
commit 6842511b10
8 changed files with 13 additions and 13 deletions

View file

@ -14,19 +14,19 @@
</body>
{{ with partial "resources/root_css.html" . -}}
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}">
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
{{- end -}}
{{- with partial "resources/section_css.html" . -}}
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}">
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
{{- end -}}
{{- with partial "resources/page_css.html" . -}}
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}">
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
{{- end -}}
{{ block "styles" . }}{{ end }}
{{ block "scripts" . }}{{ end }}
{{- with partial "resources/site_js.html" . -}}
<script type="module" src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}"></script>
<script type="module" src="{{ .RelPermalink }}"></script>
{{ end }}
</html>

View file

@ -9,16 +9,16 @@
{{ define "scripts" }}
{{- if .HasShortcode "figures/railroad" -}}
{{- with partial "resources/railroad_utils.html" . -}}
<script defer type="module" src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}"></script>
<script defer type="module" src="{{ .RelPermalink }}"></script>
{{- end -}}
{{- end -}}
{{- if .HasShortcode "figures/p5" -}}
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
<script defer src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
<script defer src="{{ .Secure.Permalink }}"></script>
{{- end -}}
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
<script defer src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
<script defer src="{{ .Secure.Permalink }}"></script>
{{- end -}}
{{- end -}}

View file

@ -1,5 +1,5 @@
{{ $pageCSS := dict }}
{{ with .Resources.Match "*.css" }}
{{ $pageCSS = . | resources.Concat "page.css" | fingerprint "sha512" }}
{{ $pageCSS = . | resources.Concat "page.css" | fingerprint "md5" }}
{{ end }}
{{ return $pageCSS }}

View file

@ -1,4 +1,4 @@
{{- $railroadUtilsJS := resources.Get "scripts/railroad-utils.js"
| resources.ExecuteAsTemplate "scripts/railroad_utils.js" .
| resources.Fingerprint "sha512" -}}
| resources.Fingerprint "md5" -}}
{{ return $railroadUtilsJS }}

View file

@ -7,5 +7,5 @@
{{ $rootCSS := $allStylesheets
| resources.Concat "styles/root.css"
| resources.ExecuteAsTemplate "styles/root.css" .
| fingerprint "sha512" }}
| fingerprint "md5" }}
{{ return $rootCSS }}

View file

@ -6,6 +6,6 @@
{{ $sectionStylesheet = printf "styles/%s.css" .Section }}
{{ end }}
{{ with resources.Get $sectionStylesheet }}
{{ $sectionCSS = . | fingerprint "sha512" }}
{{ $sectionCSS = . | fingerprint "md5" }}
{{ end }}
{{ return $sectionCSS }}

View file

@ -1,2 +1,2 @@
{{ $siteJS := resources.Get "scripts/site.js" | fingerprint "sha512" }}
{{ $siteJS := resources.Get "scripts/site.js" | fingerprint "md5" }}
{{ return $siteJS }}

View file

@ -1,5 +1,5 @@
{{ $asset := dict }}
{{ with resources.Get . }}
{{ $asset = dict "Resource" . "Secure" (. | resources.Fingerprint "sha512") }}
{{ $asset = dict "Resource" . "Secure" (. | resources.Fingerprint "md5") }}
{{ end }}
{{ return $asset }}