From a95d0e7c85665c297be14020db58a418949045c5 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Thu, 5 Mar 2026 13:51:34 +0100 Subject: [PATCH] refactor: use `helper/image` in `links.html` (#1290) * refactor: use `helper/image` in `links.html` * fix: check for $image existence before accessing --- layouts/_partials/article/components/links.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/layouts/_partials/article/components/links.html b/layouts/_partials/article/components/links.html index d64eb0b..134c159 100644 --- a/layouts/_partials/article/components/links.html +++ b/layouts/_partials/article/components/links.html @@ -14,14 +14,17 @@ {{ end }} - - {{ with $link.image }} - {{ $permalink := . }} - {{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }} - {{ $permalink = .RelPermalink }} - {{ end }} + + {{- $image := partial "helper/image" (dict "Image" $link.image "Resources" $.Resources) -}} + {{- with $image -}}
- {{ . }} + {{ . }}
{{ end }}