An RSS feed for one folder in Stati

Why contentPatterns needs a **/ in front, and the link Stati doesn't add for you.

SNP 085 #349 Filed stati rss

typescript
rss: {
  enabled: true,
  feeds: [
    {
      filename: 'blog.xml',
      title: 'My blog',
      description: 'New posts from my blog',
      contentPatterns: ['**/blog/**/*.md'],
      excludePatterns: ['**/index.md'],
      maxItems: 20,
    },
  ],
},
  • The patterns are matched against each Markdown file's full path on disk, like /home/me/my-site/site/blog/post.md, so a folder pattern needs **/ in front. 'blog/**' matches nothing and the feed comes out empty.
  • **/blog/**/*.md also matches the listing, blog/index.md, hence the excludePatterns.
  • The items take their title, description, publish date and tags (as categories) from the front matter, newest first.
  • Feeds come from stati build only, never from the dev server.

Stati doesn't advertise the feed. Add the link to the layout's <head>:

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

One gotcha in itemMapping: includeContent: true puts the post's Markdown source in the item, not its HTML, and most feed readers show that as plain text.

In the Stati docs: Filter by directory, RSS feed is empty and Include full content.