summaryrefslogtreecommitdiffstats
path: root/layouts/home.html
blob: 4eed7ad45e75aba5af1377fdcf09069d2c6dab46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{ define "main" }}
  {{ 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 }}