From f43663cf783f2daaf6c2b3f6529c8e9358a834f8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 15 Apr 2026 22:25:01 +0200 Subject: Resolve page bundle image paths correctly - Use Hugo Resources API to resolve image paths for page bundles - For images in the same directory as index.md, use image = "filename.jpg" - Template automatically resolves to correct permalink (/articles/slug/filename.jpg) - Falls back to literal image path if resource not found (for external URLs) Co-Authored-By: Claude Haiku 4.5 --- .../layouts/partials/article-list-item.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'themes/danix-xyz-hacker/layouts') diff --git a/themes/danix-xyz-hacker/layouts/partials/article-list-item.html b/themes/danix-xyz-hacker/layouts/partials/article-list-item.html index 47f3109..e491125 100644 --- a/themes/danix-xyz-hacker/layouts/partials/article-list-item.html +++ b/themes/danix-xyz-hacker/layouts/partials/article-list-item.html @@ -3,12 +3,22 @@ {{ $typeData := index $typeConfig $articleType }} {{ $excerpt := .Description | default .Summary }} +{{ $imageURL := "" }} +{{ if .Params.image }} + {{ $resource := .Resources.GetMatch .Params.image }} + {{ if $resource }} + {{ $imageURL = $resource.RelPermalink }} + {{ else }} + {{ $imageURL = .Params.image }} + {{ end }} +{{ end }} +
- {{ if .Params.image }} + {{ if $imageURL }}