|
| 1 | +{{- printf "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | safeHTML -}} |
| 2 | +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" |
| 3 | + xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> |
| 4 | + {{- $eventPages := where site.RegularPages "Section" "workshops" -}} |
| 5 | + {{- $eventPages = $eventPages | union (where site.RegularPages "Type" "in" (slice "student-talks" "hacking-hours")) -}} |
| 6 | + |
| 7 | + {{- $videoPages := slice -}} |
| 8 | + {{- range $eventPages -}} |
| 9 | + {{- if and .Params.video (ne .Params.video "") (ne .Params.upcoming true) -}} |
| 10 | + {{- $videoPages = $videoPages | append . -}} |
| 11 | + {{- end -}} |
| 12 | + {{- end -}} |
| 13 | + |
| 14 | + {{- range $videoPages -}} |
| 15 | + {{- $pageSlug := path.Base .File.Dir -}} |
| 16 | + {{- $ogImageName := printf "%s-og-16x9.jpg" $pageSlug -}} |
| 17 | + {{- $ogImageResource := .Resources.GetMatch $ogImageName -}} |
| 18 | + |
| 19 | + {{- $thumbnail_url := printf "https://i.ytimg.com/vi/%s/maxresdefault.jpg" .Params.video -}} |
| 20 | + {{- if $ogImageResource -}} |
| 21 | + {{- $thumbnail_url = $ogImageResource.Permalink -}} |
| 22 | + {{- end -}} |
| 23 | + <url> |
| 24 | + <loc>{{ .Permalink }}</loc> |
| 25 | + <video:video> |
| 26 | + <video:thumbnail_loc>{{ $thumbnail_url }}</video:thumbnail_loc> |
| 27 | + <video:title>{{ .Title | plainify }}</video:title> |
| 28 | + <video:description>{{ .Description | plainify }}</video:description> |
| 29 | + <video:player_loc>https://www.youtube.com/embed/{{ .Params.video }}</video:player_loc> |
| 30 | + {{- with .Date -}} |
| 31 | + <video:publication_date>{{ .Format "2006-01-02T15:04:05-07:00" }}</video:publication_date> |
| 32 | + {{- end -}} |
| 33 | + <video:uploader info="{{ site.BaseURL | absLangURL }}">{{ site.Title }}</video:uploader> |
| 34 | + <video:live>no</video:live> |
| 35 | + </video:video> |
| 36 | + </url> |
| 37 | + {{- end -}} |
| 38 | +</urlset> |
0 commit comments