use get-image partial

This commit is contained in:
Ben Goldsworthy 2025-06-04 17:57:21 +02:00
parent ed9e769b2d
commit edba5d203e
No known key found for this signature in database
8 changed files with 94 additions and 47 deletions

View file

@ -19,8 +19,8 @@
class="u-photo"
style="display: none;"
src="
{{- with ( $.pc.Resources.GetMatch . ) -}}
{{ partialCached "images/get-image.html" ( dict "img" . ) . }}
{{- with ( $.pc.Resources.GetMatch . ) -}}
{{- partialCached "images/get-image.html" ( dict "img" . ) .Title -}}
{{- else -}}
{{- . -}}
{{- end -}}
@ -37,7 +37,7 @@
class="article-header__featured-image"
{{ with .pc.Params.featured_image }}
{{ with ( $.pc.Resources.GetMatch . ) }}
style="background-image: url({{ partial "images/get-image.html" ( dict "img" . ) }})"
style="background-image: url({{- partialCached "images/get-image.html" ( dict "img" . ) .Title -}})"
{{ else }}
{{- if $.pc.Page.Resources -}}
{{- errorf "No Page Resource found for src '%q' (%q).\n\n\tAvailable Page Resources are:\n\t\t%v" . $.pc.Page.File.Path $.pc.Page.Resources -}}