diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-05 08:41:54 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-05 08:41:54 +0200 |
| commit | 474b8f177078cfdc2d4342e9ead4d505afa02d62 (patch) | |
| tree | f1bdf4ec77a2853f26b387f072588953a30ee907 /layouts/home.html | |
| parent | d605b77f6255a605d5afb9cd78649b1d7e301128 (diff) | |
| download | danixxyz-theme-474b8f177078cfdc2d4342e9ead4d505afa02d62.tar.gz danixxyz-theme-474b8f177078cfdc2d4342e9ead4d505afa02d62.zip | |
layout: add home, section, and page templates
Diffstat (limited to 'layouts/home.html')
| -rw-r--r-- | layouts/home.html | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/layouts/home.html b/layouts/home.html index 0c76425..4eed7ad 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -1,9 +1,20 @@ {{ define "main" }} - {{ .Content }} - {{ range site.RegularPages }} - <section> - <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> - {{ .Summary }} - </section> - {{ end }} + {{ partial "hero.html" . }} + + <div class="container feed-section"> + <div class="feed-label">Latest</div> + + {{ $posts := where site.RegularPages "Type" "in" (slice "articles") }} + {{ $posts := sort $posts "Params.date" "desc" }} + {{ $latest := first 3 $posts }} + + <div class="feed-grid"> + {{ range $latest }} + {{ $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 }} + </div> + + <a href="/articles/" class="feed-cta">View all articles</a> + </div> {{ end }} |
