1. Home
  2. ChevronRight@bdocs/plugin-rss

@bdocs/plugin-rss

Generate RSS and Atom feeds from your Boltdocs documentation with automatic i18n support.

The @bdocs/plugin-rss plugin automatically generates RSS 2.0 and Atom feeds from your documentation routes. It supports i18n, collection filtering, and requires zero configuration — just install and your site has a feed.


Quick StartLink

1. Install the packageLink

pnpm add @bdocs/plugin-rss

2. Register the pluginLink

Add the plugin to the plugins array in your configuration file:

boltdocs.config.ts
import { defineConfig } from 'boltdocs'
import rssPlugin from '@bdocs/plugin-rss'

export default defineConfig({
  siteUrl: 'https://my-docs.com',
  theme: {
    title: 'My Documentation',
  },
  plugins: [rssPlugin()],
})

3. Build and access your feedLink

After building your site, your feed is automatically available:

pnpm boltdocs build
  • RSS: https://my-docs.com/rss/feed-en.xml
  • Atom: https://my-docs.com/rss/atom-en.xml

For i18n sites, each locale gets its own feed:

  • https://my-docs.com/rss/feed-en.xml (English)
  • https://my-docs.com/rss/feed-es.xml (Spanish)

Concepts & ArchitectureLink

How It WorksLink

  1. Route Collection: After the SSG build completes, the plugin reads all generated routes from the PluginContext. These are the same routes used to generate your site's pages.

  2. Metadata Extraction: For each route, the plugin extracts title, description, excerpt, date, lastUpdated, and author from the route's frontmatter.

  3. Feed Generation: The plugin generates valid XML feeds (RSS 2.0 and/or Atom) with proper entity escaping and RFC 2822 / ISO 8601 date formatting.

  4. i18n Support: If your config has i18n enabled, the plugin automatically generates a separate feed for each locale. Routes are filtered by their locale prefix (e.g., /es/docs/... goes to the Spanish feed).

  5. Output: Feed files are written to the build output directory alongside your static site files.

When Does It Run?Link

The plugin uses the afterBuild lifecycle hook, which runs immediately after the SSG build succeeds:

EnvironmentBehavior
Production build (boltdocs build)Feeds are always generated
Development (boltdocs dev)Feeds are NOT generated by default

To generate feeds during development, set devMode: true in the plugin options.


ConfigurationLink

Minimal SetupLink

The plugin works with zero configuration. It automatically reads from your existing boltdocs.config.ts:

SourceUsed For
siteUrlFeed URL base (required — plugin warns if missing)
theme.titleFeed title (supports i18n Record<string, string>)
theme.descriptionFeed description
i18n.localesDetermines how many feeds to generate
i18n.defaultLocaleDetermines the default feed path (/feed.xml)

Plugin OptionsLink

All options are optional. Pass them to the plugin factory function:

rssPlugin({
  limit: 50,
  format: 'both',
  paths: ['/blog', '/docs'],
})

API ReferenceLink

Plugin OptionsLink

PropertyTypeDefaultDescription
limitnumberunlimitedMaximum number of items per feed. If not set, all routes are included. Range: 1–500.
pathsstring[]undefinedFilter routes by path prefix. Only routes starting with these paths are included.
collectionsstring[]undefinedFilter routes by collection name (e.g., ['blog']).
format'rss' | 'atom' | 'both''rss'Which feed format(s) to generate.
devModebooleanfalseIf true, generates feeds during boltdocs dev. Disabled by default since feeds are only useful in production.

Generated FilesLink

The plugin writes feed files to the rss/ directory inside the build output:

FormatDefault LocaleOther Locales
RSS/rss/feed-{locale}.xml/rss/feed-{locale}.xml
Atom/rss/atom-{locale}.xml/rss/atom-{locale}.xml

Feed Item FieldsLink

Each item in the feed corresponds to a documentation route:

RSS FieldAtom FieldSource
<title><title>route.title
<link><link href>siteUrl + route.path
<description><summary>route.excerpt or route.description
<pubDate><updated>route.date or route.lastUpdated
<guid><id>siteUrl + route.path

Usage ExamplesLink

Basic SetupLink

import { defineConfig } from 'boltdocs'
import rssPlugin from '@bdocs/plugin-rss'

export default defineConfig({
  siteUrl: 'https://docs.example.com',
  plugins: [rssPlugin()],
})

Blog-Only FeedLink

If you have a blog collection and only want blog posts in your feed:

rssPlugin({
  collections: ['blog'],
  limit: 30,
  format: 'both',
})

Custom Path FilterLink

Only include routes under /docs/guides:

rssPlugin({
  paths: ['/docs/guides'],
  limit: 10,
})

RSS and Atom TogetherLink

Generate both formats simultaneously:

rssPlugin({
  format: 'both',
  limit: 50,
})

TroubleshootingLink

Feed not generatedLink

  • Check siteUrl: The plugin requires siteUrl to be set in your config. Without it, the plugin logs a warning and skips generation.
  • Verify build output: Ensure the build completed successfully. The afterBuild hook only runs on successful builds.
  • Check routes: The plugin generates feeds from all documentation routes. If no routes exist, the feed will be empty.

Feed has no itemsLink

  • Check route filters: If you're using paths or collections, ensure your routes match the filter criteria.
  • Check draft flag: Routes with draft: true in frontmatter are excluded from the feed.
  • Verify frontmatter: Routes need at least a title to appear in the feed. Items without date or lastUpdated use the current timestamp.

i18n feeds missingLink

  • Verify i18n config: Ensure i18n.defaultLocale and i18n.locales are properly configured.
  • Check route locale prefixes: Routes must have locale prefixes (e.g., /es/docs/...) to be included in locale-specific feeds.

Wrong feed titleLink

The feed title is derived from theme.title. If your title is an i18n object ({ en: 'Docs', es: 'Documentación' }), the plugin uses the matching locale key. If no match is found, it falls back to the first value.

Last updated on July 27, 2026

Was this page helpful?