{{ define "main" }} {{ partial "hero.html" . }}
{{ $posts := where site.RegularPages "Type" "in" (slice "articles") }} {{ $posts := sort $posts "Params.date" "desc" }} {{ $featured := where $posts "Params.featured" true }} {{ $notFeatured := where $posts "Params.featured" "!=" true }}
{{ if $featured }}
Featured
{{ range first 1 $featured }} {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" true }} {{ partial "post-card.html" $data }} {{ end }} {{ end }} {{ if or $featured $notFeatured }} {{ if $featured }}
Latest
{{ else }}
Latest
{{ end }} {{ $latest := first 3 $notFeatured }} {{ range $latest }} {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" false }} {{ partial "post-card.html" $data }} {{ end }} {{ end }}
View all articles
{{ end }}