From 249a95d96b0b5facc7729952eebe869613825fea Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Mon, 26 Jun 2023 20:56:58 +0200 Subject: [PATCH] Toevoegen talks aan een event (subevents) --- .../partials/schemas/schema_Event.html | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/themes/nluug/layouts/partials/schemas/schema_Event.html b/themes/nluug/layouts/partials/schemas/schema_Event.html index f2860ba..da73726 100644 --- a/themes/nluug/layouts/partials/schemas/schema_Event.html +++ b/themes/nluug/layouts/partials/schemas/schema_Event.html @@ -54,6 +54,30 @@ {{- end }} ], {{ end -}} + {{ $list := where .Pages "Params.speakers" "!=" nil }} + {{ if gt (len $list) 0 }}"subEvent": [{{ end }} + {{ range $key, $value := $list }} + {{- if ne $key 0 -}}, {{ end }} + { + "@type": "Event", + "name": "{{ $value.Title }}", + "url": "{{ $value.Permalink }}", + "startDate": {{ $.Params.event_start | time.Format "2006-01-02" }}, + "endDate": {{ $.Params.event_end | time.Format "2006-01-02" }}, + "performer": [ + {{- range $index, $element := $value.Params.speakers -}} + {{- if ne $index 0 -}}, {{ end }} + { + "@type": "Person", + {{ $speaker := index $.Site.Data.personen ($element) }} + "name": "{{ $speaker.name }}" + {{ if $speaker.profile_page }},"url":"{{ $speaker.profile_page | absURL }}"{{ end }} + } + {{- end }} + ] + } +{{ end }} +{{ if gt (len $list) 0 }}],{{ end }} "mainEntityOfPage": { "@type": "Webpage", "@id": "{{ .Permalink }}#webpage",