diff --git a/data/announcements/cfp-is-open.yaml b/data/announcements/cfp-is-open.yaml new file mode 100644 index 0000000..0f238ab --- /dev/null +++ b/data/announcements/cfp-is-open.yaml @@ -0,0 +1,26 @@ +id: cfp-is-open +date_start: 2023-05-01 +date_end: 2023-08-01 +status: + - language: en + message: "Our CFP is active!" + links: + - id: 0 + name: Event details + - id: 1 + name: CFP portal + link_external: https://cfp.nluug.nl/ + - id: 2 + name: CFP tips + - language: nl + message: "Onze CFP is geopend!" + links: + - id: 0 + name: Evenement + link: "evenementen/nluug/najaarsconferentie-2023/index.md" + - id: 1 + name: Portaal + link_external: https://cfp.nluug.nl/ + - id: 2 + name: Tips + link: "evenementen/nluug/cfp/index.md" diff --git a/themes/nluug/layouts/_default/baseof.html b/themes/nluug/layouts/_default/baseof.html index 3504927..53b24ff 100644 --- a/themes/nluug/layouts/_default/baseof.html +++ b/themes/nluug/layouts/_default/baseof.html @@ -5,6 +5,7 @@
+ {{ partial "announcements.html" . }} {{ partialCached "header.html" . }} {{ partial "breadcrumb.html" . }}
diff --git a/themes/nluug/layouts/partials/announcements.html b/themes/nluug/layouts/partials/announcements.html new file mode 100644 index 0000000..15fda71 --- /dev/null +++ b/themes/nluug/layouts/partials/announcements.html @@ -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) + }} +
+ {{ range $index,$key := .status }} + {{ if eq $.Site.Language.Lang .language }} + {{ .message }} + {{ range .links }} + + {{ if .link }}[{{ .name }}]{{ end }} + {{ if .link_external }}[{{ .name }}]{{ end }} + + {{ end }} + {{ end }} + {{ end }} +
+ {{ end }} +{{ end }}