summaryrefslogtreecommitdiffstats
path: root/layouts/home.html
blob: cffb6bc83d2d446540373195e14e3b4f46ae3640 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{ define "main" }}
  {{ partial "hero.html" . }}

  <div class="container feed-section">
    <div class="feed-label">Latest</div>

    <div class="feed-grid">
      {{ $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 }}
          {{ $data := dict "title" .Title "type" $type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }}
          {{ partial "post-card.html" $data }}
        {{ end }}
      {{ end }}
    </div>

    <a href="/articles/" class="feed-cta">View all articles</a>
  </div>
{{ end }}