|
| 1 | +{{/* Event participation on a People profile. Built automatically from the site's |
| 2 | + own event pages — speakers of DuckDB × MySQL Day (the talk title comes from |
| 3 | + the page's schedule) and speakers of OurSQL Foundation webinars, matched on |
| 4 | + their `profile` link — plus the profile's own `events` front matter list for |
| 5 | + everything else (name, optional url, date, role, detail). A manual item is |
| 6 | + skipped when an automatic one already points at the same url. Context: the |
| 7 | + profile page. */}} |
| 8 | +{{ $me := strings.TrimSuffix "/" .RelPermalink }} |
| 9 | +{{ $auto := slice }} |
| 10 | + |
| 11 | +{{ with site.GetPage "/events/duckdb-mysql-day" }} |
| 12 | + {{ $ev := . }} |
| 13 | + {{ range .Params.speakers }} |
| 14 | + {{ if and .profile (eq (strings.TrimSuffix "/" .profile) $me) }} |
| 15 | + {{ $name := .name }} |
| 16 | + {{ $talk := "" }} |
| 17 | + {{ range $ev.Params.schedule }}{{ if eq .speaker $name }}{{ $talk = .title }}{{ end }}{{ end }} |
| 18 | + {{ $auto = $auto | append (dict "name" $ev.Title "url" $ev.RelPermalink "time" $ev.Date "role" "Speaker" "detail" $talk) }} |
| 19 | + {{ end }} |
| 20 | + {{ end }} |
| 21 | +{{ end }} |
| 22 | + |
| 23 | +{{ with site.GetPage "/community/webinars" }} |
| 24 | + {{ range .RegularPages }} |
| 25 | + {{ $w := . }} |
| 26 | + {{ range .Params.speakers }} |
| 27 | + {{ if and .profile (eq (strings.TrimSuffix "/" .profile) $me) }} |
| 28 | + {{ $auto = $auto | append (dict "name" (printf "OurSQL Foundation webinar: %s" $w.Title) "url" $w.RelPermalink "time" $w.Date "role" "Speaker" "detail" "") }} |
| 29 | + {{ end }} |
| 30 | + {{ end }} |
| 31 | + {{ end }} |
| 32 | +{{ end }} |
| 33 | + |
| 34 | +{{ $auto = sort $auto "time" "desc" }} |
| 35 | +{{ $autoURLs := slice }} |
| 36 | +{{ range $auto }}{{ $autoURLs = $autoURLs | append .url }}{{ end }} |
| 37 | +{{ $manual := slice }} |
| 38 | +{{ range .Params.events }} |
| 39 | + {{ if not (and .url (in $autoURLs .url)) }}{{ $manual = $manual | append . }}{{ end }} |
| 40 | +{{ end }} |
| 41 | + |
| 42 | +{{ if or $auto $manual }} |
| 43 | +<section class="person-events" aria-labelledby="person-events-title"> |
| 44 | + <h2 class="person-events-title" id="person-events-title">Event participation</h2> |
| 45 | + <ul class="person-events-list"> |
| 46 | + {{ range $auto }} |
| 47 | + <li class="person-event"> |
| 48 | + <span class="person-event-name"><a href="{{ .url }}" class="person-meta-link">{{ .name }}</a></span> |
| 49 | + <span class="person-event-date">{{ .time.Format "January 2, 2006" }}</span> |
| 50 | + <span class="person-event-role">{{ .role }}</span> |
| 51 | + {{ with .detail }}<span class="person-event-detail">{{ . }}</span>{{ end }} |
| 52 | + </li> |
| 53 | + {{ end }} |
| 54 | + {{ range $manual }} |
| 55 | + <li class="person-event"> |
| 56 | + <span class="person-event-name">{{ if .url }}<a href="{{ .url }}" class="person-meta-link">{{ .name }}</a>{{ else }}{{ .name }}{{ end }}</span> |
| 57 | + {{ with .date }}<span class="person-event-date">{{ . }}</span>{{ end }} |
| 58 | + {{ with .role }}<span class="person-event-role">{{ . }}</span>{{ end }} |
| 59 | + {{ with .detail }}<span class="person-event-detail">{{ . }}</span>{{ end }} |
| 60 | + </li> |
| 61 | + {{ end }} |
| 62 | + </ul> |
| 63 | +</section> |
| 64 | +{{ end }} |
0 commit comments