summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-05 10:22:47 +0200
committerDanilo M. <danix@danix.xyz>2026-04-05 10:22:47 +0200
commit097a22c01992ef76f5885d544fa5e4997b719a85 (patch)
tree59e0ab47bf4fcdcc94a7b157eb8da0b0e539f69d
parent8f70ad377e700b9ea3aa96bf1deab0cc2d482ba3 (diff)
downloaddanixxyz-theme-097a22c01992ef76f5885d544fa5e4997b719a85.tar.gz
danixxyz-theme-097a22c01992ef76f5885d544fa5e4997b719a85.zip
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 <noreply@anthropic.com>
-rw-r--r--layouts/home.html22
1 files changed, 4 insertions, 18 deletions
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" . }}
<div class="container feed-section">
- {{ $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 }}
+ <div class="feed-label">Latest</div>
<div class="feed-grid">
- {{ if $featured }}
- <div class="feed-label">Featured</div>
- {{ 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 }}<div class="feed-label" style="margin-top: 2rem;">Latest</div>{{ else }}<div class="feed-label">Latest</div>{{ 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 }}