Skip to content

Add RSS feed for blog posts#119

Merged
reteps merged 8 commits intomainfrom
reteps/blog-rss-feed
Feb 3, 2026
Merged

Add RSS feed for blog posts#119
reteps merged 8 commits intomainfrom
reteps/blog-rss-feed

Conversation

@reteps
Copy link
Member

@reteps reteps commented Jan 16, 2026

Adds an RSS 2.0 feed at /rss.xml for the blog.

The feed includes post titles, excerpts, tags, authors, and dates. It's generated automatically during build via getStaticProps in the blog index page. Also adds RSS autodiscovery link in the document head so RSS readers can auto-detect the feed.

Uses the rss npm library for clean XML generation.

🤖 Generated with Claude Code

- Add RSS 2.0 feed at /rss.xml with excerpts, tags, and metadata
- Generate feed during build via getStaticProps in blog index page
- Add RSS autodiscovery link in document head
- Use 'rss' library for clean XML generation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marketing Ready Ready Preview, Comment Feb 3, 2026 9:34pm

Request Review

@reteps
Copy link
Member Author

reteps commented Jan 16, 2026

Copy link
Contributor

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will approve after discussing .gitignore.

src/lib/rss.ts Outdated
import RSS from "rss";
import { BlogPostWithSlug } from "./blog";

const SITE_URL = "https://www.prairielearn.com";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may consider using the NEXT_PUBLIC_VERCEL_URL environment variable here so that this can work sensibly for preview deployments (I imagine this would be helpful for iterating on the RSS and/or PL announcement infra).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude is somewhat opposed to this:

No, NEXT_PUBLIC_VERCEL_URL isn’t ideal here. It has a few issues:

It doesn’t include the protocol (https://) - just the hostname
On preview deployments, it returns the preview URL (e.g., my-app-abc123.vercel.app), not your production domain
On production, it returns the Vercel deployment URL, not necessarily www.prairielearn.com
For RSS feeds, you want canonical production URLs regardless of which deployment built the feed. The original hardcoded value was better. Let me revert that change.

I did:

const SITE_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL 
  ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
  : "https://www.prairielearn.com";

instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair, thanks Claude!

Copy link
Contributor

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@reteps reteps merged commit adecff3 into main Feb 3, 2026
3 checks passed
@reteps reteps deleted the reteps/blog-rss-feed branch February 3, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants