Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
2 tasks
nwalters512
reviewed
Feb 3, 2026
Contributor
nwalters512
left a comment
There was a problem hiding this comment.
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"; |
Contributor
There was a problem hiding this comment.
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).
Member
Author
There was a problem hiding this comment.
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
Contributor
There was a problem hiding this comment.
That's fair, thanks Claude!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an RSS 2.0 feed at
/rss.xmlfor the blog.The feed includes post titles, excerpts, tags, authors, and dates. It's generated automatically during build via
getStaticPropsin the blog index page. Also adds RSS autodiscovery link in the document head so RSS readers can auto-detect the feed.Uses the
rssnpm library for clean XML generation.🤖 Generated with Claude Code