RSS and Atom feeds
Markspresso can automatically generate RSS 2.0 and Atom 1.0 feeds for your collections, making it easy for readers to subscribe to your content.
Enabling feeds
Feeds are configured per collection in markspresso.json. Add a feed block to any collection:
{
"collections": {
"posts": {
"path": "posts",
"layout": "post",
"permalink": "/posts/:slug/",
"feed": {
"enabled": true,
"formats": ["rss", "atom"],
"limit": 20,
"title": "My Blog",
"description": "Latest posts from my blog"
}
}
}
}
Feed configuration options
enabledโ set totrueto generate feeds for this collectionformatsโ array of feed formats to generate; valid values are"rss"and"atom"limitโ maximum number of items to include in the feed (default: 20)titleโ feed title; defaults to"Site Name - collection"if not setdescriptionโ feed description; defaults to"Latest collection from Site Name"
Output files
When feeds are enabled, Markspresso generates:
- RSS 2.0:
public/<collection>/feed.xml - Atom 1.0:
public/<collection>/atom.xml
For the default posts collection, this produces:
public/posts/feed.xml(RSS)public/posts/atom.xml(Atom)
Feed content
Each feed item includes:
- Title โ from the document's
titlefront matter - Link โ the document's canonical URL (with
baseUrlprefix) - Date โ from the document's
datefront matter or filename - Description โ from
descriptionfront matter, or a snippet of the content - Content โ full HTML content (Atom only)
Adding feed autodiscovery links
To help feed readers automatically detect your feeds, add <link> tags to your layout's <head>:
<link rel="alternate" type="application/rss+xml" title="RSS" href="/posts/feed.xml">
<link rel="alternate" type="application/atom+xml" title="Atom" href="/posts/atom.xml">
This is optional but recommended for better discoverability.
Multiple collection feeds
You can enable feeds for any collection, not just posts. Each collection with feed.enabled: true will generate its own set of feed files:
{
"collections": {
"posts": {
"path": "posts",
"feed": { "enabled": true, "formats": ["rss", "atom"] }
},
"news": {
"path": "news",
"feed": { "enabled": true, "formats": ["rss"] }
}
}
}
This produces:
public/posts/feed.xmlandpublic/posts/atom.xmlpublic/news/feed.xml