From d27b9c06bddbf2482e351aba0ce99fec2c5dafa8 Mon Sep 17 00:00:00 2001 From: Ogulcan Aydogan Date: Fri, 8 May 2026 10:34:44 +0100 Subject: [PATCH] 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 --- .../embedded/templates/_partials/_funcs/get-page-images.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tpl/tplimpl/embedded/templates/_partials/_funcs/get-page-images.html b/tpl/tplimpl/embedded/templates/_partials/_funcs/get-page-images.html index 268ceb4be..6e6a5ddfb 100644 --- a/tpl/tplimpl/embedded/templates/_partials/_funcs/get-page-images.html +++ b/tpl/tplimpl/embedded/templates/_partials/_funcs/get-page-images.html @@ -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