From bdce585ecc814b148827d9fb2a5fa4b2afe546e7 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 15 Apr 2026 22:14:02 +0200 Subject: Add thumbnail support to article listings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 'image' front matter parameter for article thumbnails - Redesign article-list-item.html as semantic article card: - Large thumbnail (aspect-video, object-cover) at top if image is present - Title linked to article page - Publication date and type badge - Excerpt (from .Description or .Summary with plainify) - "Read more" CTA button with arrow icon and hover animation - Increase list container width (max-w-2xl → max-w-3xl) and spacing (space-y-2 → space-y-6) - Thumbnail image has subtle scale-up hover effect - Arrow icon animates on hover - All three clickable elements (.image, title, CTA) link to article Co-Authored-By: Claude Haiku 4.5 --- themes/danix-xyz-hacker/layouts/_default/list.html | 2 +- .../layouts/partials/article-list-item.html | 85 +++++++++++++++------- 2 files changed, 59 insertions(+), 28 deletions(-) (limited to 'themes/danix-xyz-hacker') diff --git a/themes/danix-xyz-hacker/layouts/_default/list.html b/themes/danix-xyz-hacker/layouts/_default/list.html index 8d2c1ef..357b856 100644 --- a/themes/danix-xyz-hacker/layouts/_default/list.html +++ b/themes/danix-xyz-hacker/layouts/_default/list.html @@ -6,7 +6,7 @@ -
+
{{ $pinned := where .Pages "Params.pinned" true }} {{ $unpinned := where .Pages "Params.pinned" false }} 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 1065f0b..47f3109 100644 --- a/themes/danix-xyz-hacker/layouts/partials/article-list-item.html +++ b/themes/danix-xyz-hacker/layouts/partials/article-list-item.html @@ -1,37 +1,68 @@ {{ $articleType := .Params.type | default "life" }} {{ $typeConfig := .Site.Params.articleTypes }} {{ $typeData := index $typeConfig $articleType }} +{{ $excerpt := .Description | default .Summary }} - - - {{ if .Params.pinned }} -
- 📌 PINNED -
+
+ + {{ if .Params.image }} + + {{ .Title }} + {{ end }} - -

- {{ .Title }} -

+ +
+ + {{ if .Params.pinned }} +
+ 📌 PINNED +
+ {{ end }} + + +

+ + {{ .Title }} + +

- -
- - + +
+ + - - {{ if $typeData }} - - {{ i18n $articleType }} - + + {{ if $typeData }} + + {{ i18n $articleType }} + + {{ end }} +
+ + + {{ if $excerpt }} +

+ {{ $excerpt | plainify }} +

{{ end }} + + + + {{ i18n "readMore" }} + +
- +
-- cgit v1.2.3