RSS
Create a basic RSS Feed
- Extend Starlight’s schema (
extend
) withpubDate
andrss
(optional) fields.-
Update
src/content/config.ts
-
Update page frontmatter
-
- Install
@astrojs/rss
- Create
rss.xml.js
in thesrc/pages/
directory. This file will add RSSitems
through the Starlightdocs
content collection.
Add an RSS Stylesheet
-
Create a
styles.xsl
file somewhere in thepublic
directory. Or use the recommended the Pretty Feed v3 default Stylesheet.
Include Content (sanitized)
- Install packages
- Update
rss.xml.js
to add thecontent
from eachitem
. This project filters items, checking fordata.rss
, and sorted by descending date.
Enable RSS Auto-discovery
Update the defineConfig.integrations.starlight.head
in the project astro.config.mjs
file with the following