From: Danilo M. Date: Wed, 15 Apr 2026 20:25:01 +0000 (+0200) Subject: Resolve page bundle image paths correctly X-Git-Tag: release_22042026-1342~236 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=f43663cf783f2daaf6c2b3f6529c8e9358a834f8;p=danix.xyz-2.git 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 --- 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 }}