2
2
{{ $defaultOgImage := site.Params.metadata.image | default "images/og-image.png" | absLangURL }}
3
3
{{ $eventStartDate := "" }}{{ $eventEndDate := "" }}
4
4
{{ if $page_context.Params.start_time }}
5
- {{ $eventStartDate = printf "%sT%s" ($page_context.Date.Format "2006-01-02") $page_context.Params.start_time }}
5
+ {{ $eventStartDate = printf "%sT%s" ($page_context.Date.Format "2006-01-02") $page_context.Params.start_time }}
6
6
{{ else }}
7
- {{ $eventStartDate = $page_context.Date.Format "2006-01-02T00:00:00" }}
7
+ {{ $eventStartDate = $page_context.Date.Format "2006-01-02T00:00:00" }}
8
8
{{ end }}
9
9
{{ if $page_context.Params.end_time }}
10
- {{ $eventEndDate = printf "%sT%s" ($page_context.Date.Format "2006-01-02") $page_context.Params.end_time }}
10
+ {{ $eventEndDate = printf "%sT%s" ($page_context.Date.Format "2006-01-02") $page_context.Params.end_time }}
11
11
{{ else }}
12
- {{ $eventEndDate = $eventStartDate }}
12
+ {{ $eventEndDate = $eventStartDate }}
13
13
{{ end }}
14
14
15
15
{{ $offset := "" }}
16
16
{{ with $page_context.Params.time_zone }}
17
- {{ if eq . "CET" }}{{ $offset = "+01:00" }}{{ else if eq . "CEST" }}{{ $offset = "+02:00" }}{{ else }}{{ $offset = "Z" }}{{ end }}
17
+ {{ if eq . "CET" }}{{ $offset = "+01:00" }}{{ else if eq . "CEST" }}{{ $offset = "+02:00" }}{{ else }}{{ $offset = "Z" }}{{ end }}
18
18
{{ else }}
19
- {{ $offset = "Z" }}
19
+ {{ $offset = "Z" }}
20
20
{{ end }}
21
21
22
22
{{ $imagePath := $page_context.Params.image }}
23
23
{{ $resolvedImageURL := "" }}
24
24
{{ if $imagePath }}
25
- {{ if hasPrefix $imagePath "/" }}
26
- {{ $resolvedImageURL = $imagePath | absLangURL }}
27
- {{ else }}
28
- {{ with $page_context.Resources.GetMatch $imagePath }}
29
- {{ $resolvedImageURL = .Permalink }}
30
- {{ else }}
31
- {{ $resolvedImageURL = printf "%s%s" $page_context.RelPermalink $imagePath | absLangURL }}
32
- {{ end }}
33
- {{ end }}
25
+ {{ if hasPrefix $imagePath "/" }}
26
+ {{ $resolvedImageURL = $imagePath | absLangURL }}
34
27
{{ else }}
35
- {{ $resolvedImageURL = $defaultOgImage }}
28
+ {{ with $page_context.Resources.GetMatch $imagePath }}
29
+ {{ $resolvedImageURL = .Permalink }}
30
+ {{ else }}
31
+ {{ $resolvedImageURL = printf "%s%s" $page_context.RelPermalink $imagePath | absLangURL }}
32
+ {{ end }}
33
+ {{ end }}
34
+ {{ else }}
35
+ {{ $resolvedImageURL = $defaultOgImage }}
36
36
{{ end }}
37
37
38
38
{{ $eventLD := dict
39
- "@context" "https://schema.org"
40
- "@type" "Event"
41
- "name" $page_context.Params.Title
42
- "startDate" (printf "%s%s" $eventStartDate $offset)
43
- "endDate" (printf "%s%s" $eventEndDate $offset)
44
- "eventStatus" "https://schema.org/EventScheduled"
45
- "eventAttendanceMode" "https://schema.org/OnlineEventAttendanceMode"
46
- "location" (dict "@type" "VirtualLocation" "url" "https://youtube.com/@openneuromorphic")
47
- "image" (slice $resolvedImageURL)
48
- "description" $page_context.Params.Description
49
- "offers" (dict "@type" "Offer" "price" "0" "availability" "https://schema.org/InStock")
39
+ "@context" "https://schema.org"
40
+ "@type" "Event"
41
+ "name" $page_context.Params.Title
42
+ "startDate" (printf "%s%s" $eventStartDate $offset)
43
+ "endDate" (printf "%s%s" $eventEndDate $offset)
44
+ "eventStatus" "https://schema.org/EventScheduled"
45
+ "eventAttendanceMode" "https://schema.org/OnlineEventAttendanceMode"
46
+ "location" (dict "@type" "VirtualLocation" "url" "https://youtube.com/@openneuromorphic")
47
+ "image" (slice $resolvedImageURL)
48
+ "description" $page_context.Params.Description
49
+ "offers" (dict
50
+ "@type" "Offer"
51
+ "price" "0"
52
+ "priceCurrency" "USD"
53
+ "availability" "https://schema.org/InStock"
54
+ "url" ($page_context.Permalink | absLangURL)
55
+ "validFrom" ($page_context.Date.Format "2006-01-02T15:04:05Z07:00")
56
+ )
50
57
}}
51
58
{{ if $page_context.Params.author }}
52
- {{ $authorList := slice }}
53
- {{ with $page_context.Params.author }}{{ if reflect.IsSlice . }}{{ $authorList = . }}{{ else }}{{ $authorList = slice . }}{{ end }}{{ end }}
59
+ {{ $authorList := slice }}
60
+ {{ with $page_context.Params.author }}{{ if reflect.IsSlice . }}{{ $authorList = . }}{{ else }}{{ $authorList = slice . }}{{ end }}{{ end }}
54
61
55
- {{ $performers := slice }}
56
- {{ range $authorList }}
57
- {{ $authorName := . }}
58
- {{ $nameForProcessing := $authorName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }}
59
- {{ $contributorSlug := $nameForProcessing | anchorize }}
60
- {{ $contributorPage := site.GetPage (printf "contributors/%s" $contributorSlug) }}
62
+ {{ $performers := slice }}
63
+ {{ range $authorList }}
64
+ {{ $authorName := . }}
65
+ {{ $nameForProcessing := $authorName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }}
66
+ {{ $contributorSlug := $nameForProcessing | anchorize }}
67
+ {{ $contributorPage := site.GetPage (printf "contributors/%s" $contributorSlug) }}
61
68
62
- {{ $personDict := dict "@type" "Person" "name" $authorName }}
63
- {{ if $contributorPage }}
64
- {{ $personDict = merge $personDict (dict "url" ($contributorPage.Permalink | absLangURL)) }}
65
- {{ end }}
66
- {{ $performers = $performers | append $personDict }}
67
- {{ end }}
68
- {{ $eventLD = merge $eventLD (dict "performer" $performers) }}
69
+ {{ $personDict := dict "@type" "Person" "name" $authorName }}
70
+ {{ if $contributorPage }}
71
+ {{ $personDict = merge $personDict (dict "url" ($contributorPage.Permalink | absLangURL)) }}
72
+ {{ end }}
73
+ {{ $performers = $performers | append $personDict }}
74
+ {{ end }}
75
+ {{ $eventLD = merge $eventLD (dict "performer" $performers) }}
69
76
{{ end }}
70
77
{{ $eventLD = merge $eventLD (dict "organizer" (dict "@type" "Organization" "name" "Open Neuromorphic" "url" (absLangURL "/"))) }}
71
78
72
- {{ return $eventLD }}
79
+ {{ return $eventLD }}
0 commit comments