🔥 All-Access Pass — $199 USD (Regular $499) · Unlock all 2,836 Astro themes ➔
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Docs/Working With Your Theme/RSS Feeds

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 <head> so readers and browsers can discover it:

html
<link rel="alternate" type="application/rss+xml" title="Journal" href="/rss.xml" />

context.site comes from site in astro.config.mjs. If that is unset, item links resolve relative and most readers will reject the feed.

Unlock every theme

Get lifetime access to 2,836 themes for $199 USD (Regular $499 USD).

Get All-Access Pass ($199) ➔