diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 0116b4b..0f547f8 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -13,40 +13,24 @@ {{ end }} - - - {{- if not hugo.IsProduction -}} - - {{- end -}} - - {{- $includedCSS := slice -}} - {{- if not .FirstSection.IsHome -}} - {{- range .FirstSection.Resources.Match "*.css" -}} - {{- if not (in $includedCSS .Permalink) -}} - {{- $includedCSS = $includedCSS | append .Permalink -}} - - {{- end -}} - {{- end -}} - {{- end -}} - - {{- range .Resources.Match "*.css" -}} - {{- if not (in $includedCSS .Permalink) -}} - {{- $includedCSS = $includedCSS | append .Permalink -}} - - {{- end -}} - {{- end -}} + {{- $rootCSS := resources.Get "styles/root.css" + | resources.ExecuteAsTemplate "root.css" . + | resources.Fingerprint "sha512" -}} + + {{ if not hugo.IsProduction }} + + {{ end }} + {{ with partial "secure_asset.html" (printf "styles/%s.css" .Section) }} + + {{ end }} + {{ range .Resources.Match "*.css" }} + + {{ end }} {{ block "styles" . }}{{ end }} - {{ block "scripts" . }}{{ end }} - + {{ $concatenatedSiteScript := resources.Get "scripts/site.js" + | resources.Fingerprint "sha512" }} + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index dfaae82..fb78001 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,25 +8,33 @@ {{ define "styles" }} {{- if .HasShortcode "figures/railroad" -}} - + {{- end -}} {{ end }} {{ define "scripts" }} {{- if .HasShortcode "figures/railroad" -}} - - + {{- with partial "secure_asset.html" "scripts/lib/railroad.js" -}} + + {{- end -}} + {{- with resources.Get "scripts/railroad-utils.js" -}} + + {{- end -}} {{- end -}} {{- if .HasShortcode "figures/p5" -}} - - + {{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}} + + {{- end -}} + {{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}} + + {{- end -}} {{- end -}} {{- range $script := .Resources.Match "*.js" -}} - {{- $isModule := default true $script.Params.is_module -}} - + {{- $isModule := default true $script.Params.is_module -}} + {{- end -}} {{ end }}