{{ define "main" }}
<article>
{{ .Content }}
{{ if gt (len (where .Site.RegularPages "Section" "nieuws")) 0 }}
<section>
<h2>Latest news</h2>
<ul class="list">
{{ range (first 5 (where .Site.RegularPages "Section" "nieuws").ByDate.Reverse) }}
<li>
<a class="link" href="{{ .RelPermalink }}">{{ .Title }}</a>
<hr class="hr-list">
<time class="g time" datetime="{{ dateFormat "2006-01-02" .Date }}">{{ dateFormat "02-01-2006" .Date }}</time>
</li>
{{ end }}
</ul>
</section>
{{ $upcoming_events := sort .Site.Data.evenementen.kalender "date_start" "asc" }}
<h2>Upcoming events</h2>
<p>The upcoming events where Fediversity will be present:</p>
<ul>
{{ range first 10 (where $upcoming_events "date_start" "ge" (dateFormat "2006-01-02" now)) }}
<li><time datetime="{{ .date_start | dateFormat "2006-01-02" }}">{{ .date_start | dateFormat "02-01-2006" }}</time> - <a href="/evenementen/kalender/#{{ anchorize (.date_start | dateFormat "2006-01-02") }}-{{ anchorize .name }}">{{ .name }}</a></li>
<p>» <a href="/evenementen/kalender/">Entire calendar.</a></p>
</article>