diff options
Diffstat (limited to 'layouts/home.html')
| -rw-r--r-- | layouts/home.html | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/layouts/home.html b/layouts/home.html index 6328ee5..54d8087 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -3,25 +3,46 @@ {{ define "main" }} {{ partial "hero.html" . }} - <section id="articles" class="section-container reveal-group"> + <section id="articles" class="section-container reveal-group" + style="background: var(--bg2); padding: 6rem 2rem;"> + + <div class="section-header"> + <p class="section-eyebrow">// latest posts</p> + <h2 class="section-title">Recent Articles</h2> + </div> + {{ $articlesSection := .Site.GetPage "/articles" }} {{ if $articlesSection }} {{ $articles := $articlesSection.Pages }} - {{ $articles := sort $articles "Date" "desc" }} - {{ range first 6 $articles }} - {{ $type := .Params.type }} - {{ if not $type }}{{ $type = "article" }}{{ end }} - - {{ $excerpt := .Params.excerpt }} - {{ if not $excerpt }} - {{ $excerpt = .Summary | plainify | truncate 150 }} - {{ end }} + {{ $articles = sort $articles "Date" "desc" }} + <div class="articles-grid"> + {{ range first 6 $articles }} + {{ $type := .Params.type }} + {{ if not $type }}{{ $type = "article" }}{{ end }} - {{ $data := dict "title" .Title "type" $type "description" $excerpt "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }} - {{ partial "post-card.html" $data }} - {{ end }} + {{ $excerpt := .Params.excerpt }} + {{ if not $excerpt }} + {{ $excerpt = .Summary | plainify | truncate 150 }} + {{ end }} + + {{ $data := dict + "title" .Title + "type" $type + "description" $excerpt + "date" .Date + "url" .RelPermalink + "image" .Params.image + "featured" .Params.featured + "context" "home" + }} + {{ partial "post-card.html" $data }} + {{ end }} + </div> {{ end }} - <a href="/articles/" class="btn btn-outline">View All Articles</a> + <div style="text-align: center; margin-top: 3rem;"> + <a href="/articles/" class="btn btn-outline">View All Articles</a> + </div> + </section> {{ end }} |
