Toevoegen van announcements

This commit is contained in:
Michael Boelen 2023-06-27 10:33:26 +02:00
parent a303e6ddc4
commit 2d23a52eb5
3 changed files with 50 additions and 0 deletions

View file

@ -5,6 +5,7 @@
<!-- Accessibility: skip-link voor mobiele apparaten -->
<a class="skip-link" href="#main">Ga naar hoofd</a>
<main id="main">
{{ partial "announcements.html" . }}
{{ partialCached "header.html" . }}
{{ partial "breadcrumb.html" . }}
<div class="content">

View file

@ -0,0 +1,23 @@
{{ $context := . }}
{{ range $.Site.Data.announcements }}
{{ $date_end := .date_end | time }}
{{ $date_start := .date_start | time }}
{{ if and
(ge now $date_start)
(le now $date_end)
}}
<div class="max-width ta-r">
{{ range $index,$key := .status }}
{{ if eq $.Site.Language.Lang .language }}
<span class="darkgreen bold">{{ .message }}</span>
{{ range .links }}
<small>
{{ if .link }}[<a href="{{ relref $context .link }}">{{ .name }}</a>]{{ end }}
{{ if .link_external }}[<a href="{{ .link_external }}" rel="nofollow noopener">{{ .name }}</a>]{{ end }}
</small>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}