mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user