From: Danilo M. Date: Sun, 5 Apr 2026 08:22:47 +0000 (+0200) Subject: fix: restore article display on homepage X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=097a22c01992ef76f5885d544fa5e4997b719a85;p=danix2-hugo-theme.git fix: restore article display on homepage Simplified home.html article query to directly iterate over all pages with Type='articles'. The previous complex featured article filtering was breaking the display. Now shows all articles in latest-first order with proper grid layout. Co-Authored-By: Claude Haiku 4.5 --- diff --git a/layouts/home.html b/layouts/home.html index 0beae1f..4d8587a 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -2,26 +2,12 @@ {{ partial "hero.html" . }}
- {{ $posts := where site.RegularPages "Type" "in" (slice "articles") }} - {{ $posts := sort $posts "Params.date" "desc" }} - - {{ $featured := where $posts "Params.featured" true }} - {{ $notFeatured := where $posts "Params.featured" "!=" true }} +
Latest
- {{ if $featured }} -
Featured
- {{ range first 1 $featured }} - {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" true }} - {{ partial "post-card.html" $data }} - {{ end }} - {{ end }} - - {{ if or $featured $notFeatured }} - {{ if $featured }}
Latest
{{ else }}
Latest
{{ end }} - {{ $latest := first 3 $notFeatured }} - {{ range $latest }} - {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" false }} + {{ range site.RegularPages }} + {{ if eq .Type "articles" }} + {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }} {{ partial "post-card.html" $data }} {{ end }} {{ end }}