Files

19 lines
620 B
HTML

{{/* section
label: Latest
about: The newest pages of a collection, as cards.
fields:
- { name: heading, type: text }
- { name: collection, type: collection, default: articles }
- { name: count, type: number, default: 3, label: How many }
*/}}
{{ $n := default 3 .Data.count }}{{ $c := default "articles" .Data.collection }}
<section class="block">
<div class="wrap">
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
<ul class="cards">
{{ range limit $n (collection $c) }}{{ template "card" . }}{{ end }}
</ul>
<p><a class="more" href="/{{ $c }}/">All {{ $c }}</a></p>
</div>
</section>