From: Danilo M. Date: Tue, 21 Apr 2026 09:34:55 +0000 (+0200) Subject: feat: rewrite article-list-item as timeline card partial X-Git-Tag: release_22042026-1342~47 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=321252d606511ddd9e8e365e39109057b0d22027;p=danix.xyz-2.git feat: rewrite article-list-item as timeline card partial --- 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 d0ab504..44cbf32 100644 --- a/themes/danix-xyz-hacker/layouts/partials/article-list-item.html +++ b/themes/danix-xyz-hacker/layouts/partials/article-list-item.html @@ -1,93 +1,95 @@ -{{ $articleType := .Params.type | default "life" }} -{{ $typeConfig := .Site.Params.articleTypes }} +{{/* Handle both calling conventions: dict with .Page/.side or direct page */}} +{{ $page := . }} +{{ $side := "left" }} + +{{ if reflect.IsMap . }} + {{ $page = .Page }} + {{ $side = .side | default "left" }} +{{ end }} + +{{ $articleType := $page.Params.type | default "life" }} +{{ $typeConfig := $page.Site.Params.articleTypes }} {{ $typeData := index $typeConfig $articleType }} -{{ $excerpt := .Description | default .Summary }} +{{ $excerpt := $page.Description | default $page.Summary }} {{ $imageURL := "" }} {{ $useDefaultThumbnail := false }} -{{ if .Params.image }} - {{ $resource := .Resources.GetMatch .Params.image }} +{{ if $page.Params.image }} + {{ $resource := $page.Resources.GetMatch $page.Params.image }} {{ if $resource }} {{ $imageURL = $resource.RelPermalink }} {{ else }} - {{ $imageURL = .Params.image }} + {{ $imageURL = $page.Params.image }} {{ end }} {{ else }} {{ $useDefaultThumbnail = true }} {{ end }} -
- - {{ if or $imageURL $useDefaultThumbnail }} - - {{ if $useDefaultThumbnail }} - - - {{ .Title }} - - {{ else }} - {{ .Title }} - {{ end }} - - {{ if $typeData }} -
- {{ i18n $articleType }} -
- {{ end }} -
- {{ end }} +
  • + {{/* Decorative connector line */}} + - -
    - - {{ if .Params.pinned }} -
    - 📌 PINNED -
    - {{ end }} + {{/* Node on spine */}} + - -

    - - {{ .Title }} - -

    + + {{/* Pinned badge */}} + {{ if $page.Params.pinned }} +
    + 📌 {{ i18n "pinned" | default "PINNED" }} +
    + {{ end }} + + {{/* Type + date meta row */}} +
    + {{ i18n $articleType | upper }} + + +
    + + {{/* Title */}} +

    + {{ $page.Title }} +

    + + {{/* Excerpt */}} + {{ if $excerpt }} +

    {{ $excerpt | plainify }}

    + {{ end }} + + {{/* CTA */}} + + {{ i18n "readMore" }} + + + +
    +
  • +