{{ 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 }}
