tpl/tplimpl: Extend page image lookup to include global resources

Fall back to global resources via resources.Get when page resources
don't match for named images in the images front matter parameter.
This aligns get-page-images.html with the existing behavior in
render-image.html, render-link.html, and figure.html.

Fixes #14062
This commit is contained in:
Ogulcan Aydogan
2026-05-08 10:34:44 +01:00
committed by GitHub
parent 62cef3678b
commit d27b9c06bd
@@ -23,9 +23,8 @@
{{- $img := . }}
{{- $url := urls.Parse $img }}
{{- if eq $url.Scheme "" }}
{{/* Internal image. */}}
{{- with $resources.GetMatch $img -}}
{{/* Image resource. */}}
{{/* Internal image: check page resources first, then global resources. */}}
{{- with or ($resources.GetMatch $img) (resources.Get $img) -}}
{{- $imgs = $imgs | append (dict
"Image" .
"RelPermalink" .RelPermalink