Fix template caching issue with Bootstrap colors

master
Will Faught 2 years ago
parent 116c4f83f4
commit 8ba9239c5c

@ -7,6 +7,7 @@
{{ $page := $params.page }} {{ $page := $params.page }}
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }} {{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
{{ $sass := $params.sass }} {{ $sass := $params.sass }}
{{ $template := $params.template }}
{{ $enablesourcemap := not hugo.IsProduction }} {{ $enablesourcemap := not hugo.IsProduction }}
{{ $outputstyle := cond hugo.IsProduction "compressed" "" }} {{ $outputstyle := cond hugo.IsProduction "compressed" "" }}
@ -16,7 +17,13 @@
{{ end }} {{ end }}
{{ with partial "paige/resource.html" (dict "page" $page "url" $href) }} {{ with partial "paige/resource.html" (dict "page" $page "url" $href) }}
{{ $resource := resources.ExecuteAsTemplate $href (or $page dict) . }} {{ $resource := . }}
{{ if $template }}
{{ $split := path.Split $href }}
{{ $join := path.Join $split.Dir (print (sha1 $page) "-" $split.File) }}
{{ $resource = resources.ExecuteAsTemplate $join (or $page dict) . }}
{{ end }}
{{ if $sass }} {{ if $sass }}
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $includepaths "outputStyle" $outputstyle "transpiler" "dartsass") }} {{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $includepaths "outputStyle" $outputstyle "transpiler" "dartsass") }}

@ -32,7 +32,7 @@
<link href="{{ (resources.Get `site.webmanifest` | resources.ExecuteAsTemplate `site.webmanifest` .).RelPermalink | safeURL }}" rel="manifest"> <link href="{{ (resources.Get `site.webmanifest` | resources.ExecuteAsTemplate `site.webmanifest` .).RelPermalink | safeURL }}" rel="manifest">
{{ end }} {{ end }}
{{ partial "paige/link.html" (dict "href" "_paige/bootstrap/paige.scss" "page" $page "sass" true) }} {{ partial "paige/link.html" (dict "href" "_paige/bootstrap/paige.scss" "page" $page "sass" true "template" true) }}
{{ partial "paige/link.html" (dict "href" "_paige/bootstrap-icons/bootstrap-icons.css") }} {{ partial "paige/link.html" (dict "href" "_paige/bootstrap-icons/bootstrap-icons.css") }}
{{ if $page.Param "paige.math" }} {{ if $page.Param "paige.math" }}

Loading…
Cancel
Save