Menu

Our blog's RSS feed is one string join, and all five posts in it share one pubDate
📰

Our blog's RSS feed is one string join, and all five posts in it share one pubDate

DEV Community: typescript·Daniel Pertu·about 19 hours ago
#gmdLNlyf
#devtotypescript#devto#dev#feed#article
Reading 0:00
15s threshold

Nakodo has a blog with five posts on it. The posts are TypeScript files: a title, a summary, and an array of typed blocks that one renderer turns into a page. There is no CMS and no markdown loader, so when I wanted a feed there was nothing to plug in.

The whole feed is a route handler that joins strings. You can read the output before the code: nakodo.app/blog/feed.xml .

$ curl -s -o /dev/null -w '%{http_code} %{size_download} %{content_type}\n' \ https://nakodo.app/blog/feed.xml 200 4774 application/rss+xml ; charset = utf-8

Enter fullscreen mode

Exit fullscreen mode

The route

The file is src/app/(marketing)/blog/feed.xml/route.ts .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.