Remove page param from resource.html

This commit is contained in:
Will Faught
2023-04-23 21:42:58 -07:00
parent de7bd8d243
commit 9f18874c4c
4 changed files with 8 additions and 13 deletions

View File

@@ -4,7 +4,6 @@
{{ $href := $params.href }}
{{ $includepaths := $params.includepaths }}
{{ $integrity := $params.integrity }}
{{ $page := $params.page }}
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
{{ $sass := $params.sass }}
{{ $template := $params.template }}
@@ -16,11 +15,11 @@
{{ errorf "paige/link: no href" }}
{{ end }}
{{ with partial "paige/resource.html" (dict "page" $page "url" $href) }}
{{ with partial "paige/resource.html" $href }}
{{ $resource := . }}
{{ if $template }}
{{ $context := dict "color" ($page.Param "paige.color" | default "#0d6efd") }}
{{ $context := dict "color" (page.Param "paige.color" | default "#0d6efd") }}
{{ $split := path.Split $href }}
{{ $join := path.Join $split.Dir (print (printf "%#v" $context | sha1) "-" $split.File) }}
{{ $resource = resources.ExecuteAsTemplate $join $context . }}