Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/_default/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ module:
outputFormats:
rss:
baseName: rss
rssupcoming:
mediaType: application/rss+xml
baseName: rss-upcoming
rssondemand:
mediaType: application/rss+xml
baseName: rss-ondemand
llms:
mediaType: "text/plain"
baseName: "llms"
Expand Down
2 changes: 1 addition & 1 deletion content/events/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,5 @@ sections:
- label: On-demand
anchor: on-demand

outputs: ["html", "rss"]
outputs: ["html", "rss", "rssupcoming", "rssondemand"]
---
7 changes: 7 additions & 0 deletions layouts/events/list.rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- $feeds := partial "events/feed-events.html" . -}}
{{- partial "events/rss-channel.html" (dict
"ctx" .
"events" $feeds.all
"title" "Pulumi Events"
"description" "All Pulumi events and on-demand recordings.")
-}}
7 changes: 7 additions & 0 deletions layouts/events/list.rssondemand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- $feeds := partial "events/feed-events.html" . -}}
{{- partial "events/rss-channel.html" (dict
"ctx" .
"events" $feeds.ondemand
"title" "Pulumi Events – On-demand"
"description" "On-demand Pulumi event and workshop recordings.")
-}}
7 changes: 7 additions & 0 deletions layouts/events/list.rssupcoming.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- $feeds := partial "events/feed-events.html" . -}}
{{- partial "events/rss-channel.html" (dict
"ctx" .
"events" $feeds.upcoming
"title" "Pulumi Events – Upcoming"
"description" "Upcoming Pulumi events and workshops.")
-}}
29 changes: 0 additions & 29 deletions layouts/events/rss.xml

This file was deleted.

36 changes: 36 additions & 0 deletions layouts/partials/events/feed-events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{/*
Events Feed Source Partial

Computes the event slices used by the events RSS feeds, mirroring the
upcoming/on-demand logic in partials/events/list-section.html so the feeds
match exactly what the events page lists. Returns a dict with three slices:

all - every listed event, newest first
upcoming - upcoming events, soonest first
ondemand - on-demand recordings, newest first

Listed = unlisted == false. An event is "upcoming" while its sortable_date
(plus a 24h grace window) is in the future; once past, it is "on-demand"
only if it has a youtube_url recording.
*/}}

{{ $nowUnix := now.UnixMilli }}
{{ $upcoming := slice }}
{{ $ondemand := slice }}

{{ range (where site.Pages "Type" "events") }}
{{ if eq .Params.unlisted false }}
{{ $eventDateUnix := (add (.Params.sortable_date | time.AsTime).UnixMilli (duration "hour" 24).Milliseconds) }}
{{ if lt $nowUnix $eventDateUnix }}
{{ $upcoming = $upcoming | append . }}
{{ else if .Params.youtube_url }}
{{ $ondemand = $ondemand | append . }}
{{ end }}
{{ end }}
{{ end }}

{{ $upcoming = sort $upcoming "Params.sortable_date" "asc" }}
{{ $ondemand = sort $ondemand "Params.sortable_date" "desc" }}
{{ $all := sort (append $upcoming $ondemand) "Params.sortable_date" "desc" }}

{{ return (dict "all" $all "upcoming" $upcoming "ondemand" $ondemand) }}
40 changes: 40 additions & 0 deletions layouts/partials/events/rss-channel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{/*
Events RSS Channel Partial

Renders a complete RSS 2.0 document for a set of events. Shared by the
combined and per-section events feeds.

Expected context (dict):
ctx - the events list Page (for site params and the feed link)
events - a slice of event Pages to render as items
title - the channel <title>
description - the channel <description>
*/ -}}
{{- $ctx := .ctx -}}
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0">
<channel>
<title>{{ .title }}</title>
<link>{{ $ctx.Site.Params.canonicalURL }}{{ $ctx.RelPermalink }}</link>
<description>{{ .description }}</description>
<language>{{ $ctx.Site.LanguageCode }}</language>
<pubDate>{{ now | time.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ range .events }}
<item>
{{ $eventLink := printf "%s%s" $ctx.Site.Params.canonicalURL .RelPermalink }}
<!--
When the event is external, the `url_slug` property is set to the external link
in the event template.
-->
{{ if .Params.external }}
{{ $eventLink = .Params.url_slug }}
{{ end }}
<guid>{{ $eventLink }}</guid>
<title>{{ .Params.title }}</title>
<description>{{ .Params.meta_desc }}</description>
<pubDate>{{ (.Params.sortable_date | time.AsTime).Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ $eventLink }}</link>
</item>
{{ end }}
</channel>
</rss>
7 changes: 7 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@
<!-- RSS link for the blog. -->
<link rel="alternate" type="application/rss+xml" href="{{ "/blog/rss.xml" | absURL }}" title="Pulumi Blog" />

<!-- RSS links for the events section. -->
{{ if eq .Section "events" }}
<link rel="alternate" type="application/rss+xml" href="{{ "/events/rss.xml" | absURL }}" title="Pulumi Events" />
<link rel="alternate" type="application/rss+xml" href="{{ "/events/rss-upcoming.xml" | absURL }}" title="Pulumi Events – Upcoming" />
<link rel="alternate" type="application/rss+xml" href="{{ "/events/rss-ondemand.xml" | absURL }}" title="Pulumi Events – On-demand" />
{{ end }}


<script>
window.addEventListener('load', function() {
Expand Down
Loading