All the template updates for fingerprinting
This commit is contained in:
parent
1751abadac
commit
d0b223fa33
2 changed files with 31 additions and 39 deletions
|
@ -13,40 +13,24 @@
|
|||
{{ end }}
|
||||
</body>
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "Museo_Slab";
|
||||
src: url("{{ `/fonts/Museo_Slab_500.woff2` | relURL }}") format("woff2"),
|
||||
url("{{ `/fonts/Museo_Slab_500.woff` | relURL }}") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" as="style" href="{{ `/styles/root.css` | relURL }}">
|
||||
{{- if not hugo.IsProduction -}}
|
||||
{{- $rootCSS := resources.Get "styles/root.css"
|
||||
| resources.ExecuteAsTemplate "root.css" .
|
||||
| resources.Fingerprint "sha512" -}}
|
||||
<link rel="stylesheet" as="style" href="{{ $rootCSS.RelPermalink }}" integrity="{{ $rootCSS.Data.Integrity }}">
|
||||
{{ if not hugo.IsProduction }}
|
||||
<link rel="stylesheet" as="style" href="{{ `/styles/development.css` | relURL }}">
|
||||
{{- end -}}
|
||||
|
||||
{{- $includedCSS := slice -}}
|
||||
{{- if not .FirstSection.IsHome -}}
|
||||
{{- range .FirstSection.Resources.Match "*.css" -}}
|
||||
{{- if not (in $includedCSS .Permalink) -}}
|
||||
{{- $includedCSS = $includedCSS | append .Permalink -}}
|
||||
{{ end }}
|
||||
{{ with partial "secure_asset.html" (printf "styles/%s.css" .Section) }}
|
||||
<link rel="stylesheet" as="style" href="{{ .Secure.RelPermalink }}" integrity="{{ .Secure.Data.Integrity }}">
|
||||
{{ end }}
|
||||
{{ range .Resources.Match "*.css" }}
|
||||
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range .Resources.Match "*.css" -}}
|
||||
{{- if not (in $includedCSS .Permalink) -}}
|
||||
{{- $includedCSS = $includedCSS | append .Permalink -}}
|
||||
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
{{ block "styles" . }}{{ end }}
|
||||
|
||||
{{ block "scripts" . }}{{ end }}
|
||||
|
||||
<script src="{{ `scripts/site.js` | relURL }}"></script>
|
||||
{{ $concatenatedSiteScript := resources.Get "scripts/site.js"
|
||||
| resources.Fingerprint "sha512" }}
|
||||
<script type="module" src="{{ $concatenatedSiteScript.Permalink }}" integrity="{{ $concatenatedSiteScript.Data.Integrity }}"></script>
|
||||
</html>
|
||||
|
|
|
@ -15,13 +15,21 @@
|
|||
|
||||
{{ define "scripts" }}
|
||||
{{- if .HasShortcode "figures/railroad" -}}
|
||||
<script defer type="module" src="{{ `scripts/railroad.js` | absURL }}"></script>
|
||||
<script defer type="module" src="{{ `scripts/railroad-utils.js` | absURL }}"></script>
|
||||
{{- with partial "secure_asset.html" "scripts/lib/railroad.js" -}}
|
||||
<script defer type="module" src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
|
||||
{{- end -}}
|
||||
{{- with resources.Get "scripts/railroad-utils.js" -}}
|
||||
<script defer type="module" src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .HasShortcode "figures/p5" -}}
|
||||
<script defer src="{{ `scripts/p5-1.4.1.min.js` | absURL }}"></script>
|
||||
<script defer src="{{ `scripts/sketch-utils.js` | absURL }}"></script>
|
||||
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
|
||||
<script defer src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
|
||||
{{- end -}}
|
||||
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
|
||||
<script defer src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $script := .Resources.Match "*.js" -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue