Add RSS feed and expose it in head/footer - #23
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
website-v1 | 193f1e3 | Jan 03 2026, 09:04 AM |
There was a problem hiding this comment.
Performed full review of b25ba1d...492e7f9
Analysis
-
The manual
<head>insertion inlayout.tsxviolates Next.js App Router best practices - should use Metadata API orgenerateMetadatato prevent potential hydration issues. -
XML content is inconsistently escaped - the
escapeXmlfunction is not applied to URLs in<link>and<guid>tags, which could produce malformed XML with special characters. -
Missing input validation for required post fields (title, description, date, slug) before including them in the RSS feed.
-
Lacks error handling around
getAllPosts()and date parsing operations, which could cause the entire feed generation to fail without graceful degradation.
Tip
Help
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
0 files reviewed | 2 comments | Edit Agent Settings • Read Docs
| <rss version="2.0"> | ||
| <channel> | ||
| <title>Ivan Leo - Blog</title> | ||
| <link>${baseUrl}/blog</link> |
There was a problem hiding this comment.
The baseUrl in the channel link is not being escaped. While unlikely to contain special characters, for consistency and robustness: <link>${escapeXml(baseUrl)}/blog</link>
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: ivanleomk/website-v4#23
File: src/app/rss.xml/route.ts#L45
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
The baseUrl in the channel link is not being escaped. While unlikely to contain special characters, for consistency and robustness: `<link>${escapeXml(baseUrl)}/blog</link>`
|
|
||
| export async function GET(): Promise<Response> { | ||
| const posts = await getAllPosts(); | ||
| const publishedPosts = posts.filter((post) => !post.draft); |
There was a problem hiding this comment.
The filter for published posts doesn't validate that posts have required fields (title, description, date, slug). If a post is missing these fields, the RSS feed will have malformed items. Consider adding validation or filtering out posts without required fields.
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: ivanleomk/website-v4#23
File: src/app/rss.xml/route.ts#L18
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
The filter for published posts doesn't validate that posts have required fields (title, description, date, slug). If a post is missing these fields, the RSS feed will have malformed items. Consider adding validation or filtering out posts without required fields.
Motivation
Description
src/app/rss.xml/route.tsthat generates an RSS 2.0 feed from posts returned bygetAllPosts()and filters out drafts.Content-Type: application/rss+xml; charset=utf-8headers, withexport const revalidate = 3600for caching.<link rel="alternate" type="application/rss+xml" href="/rss.xml" />insrc/app/layout.tsxto advertise the feed in page head metadata.RSSlink to the blog footer insrc/app/blog/page.tsxand give the footer anid="blog-footer"for discovery/testing.Testing
net::ERR_EMPTY_RESPONSEwhen trying to loadhttp://localhost:3000/blog.Codex Task
TL;DR
Adds an RSS feed at
/rss.xmlto allow readers to subscribe to new blog posts and makes it discoverable in the site's header and footer.Why we made these changes
To provide a standard way for readers to subscribe to new content and ensure the feed is easily found by both users and RSS clients.
What changed?
src/app/rss.xml/route.tsto generate an RSS 2.0 feed from published blog posts, with appropriate XML escaping andContent-Typeheaders. The feed is cached for one hour.<link rel="alternate">tag insrc/app/layout.tsxto advertise the RSS feed in the site's head metadata.src/app/blog/page.tsxfor user visibility.Validation
Description generated by Mesa. Update settings