RSS Feeds
Every theme ships a working feed — here is how it is wired and how to change it.
Updated: September 2026·License: Commercial & Personal
The feed endpoint
The feed is a route like any other. It lives at src/pages/rss.xml.js and is served at /rss.xml:
js
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
export async function GET(context) {
const posts = await getCollection('journal', ({ data }) => !data.draft);
return rss({
title: 'Journal',
description: 'Notes from the studio.',
site: context.site,
items: posts.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.publishDate,
link: `/journal/${post.id}/`,
})),
});
}Linking it
Add the feed to your so readers and browsers can discover it:
html
<link rel="alternate" type="application/rss+xml" title="Journal" href="/rss.xml" />context.sitecomes fromsiteinastro.config.mjs. If that is unset, item links resolve relative and most readers will reject the feed.
Explore production-ready themes
Hand-built Astro themes — SaaS, storefront, portfolio, and dashboard.