RSS Plugin
Purpose
Generates per-language RSS 2.0 feeds from published content files. Supports configurable feed filename, TTL, item count limits, schema type filtering, and category filtering.
Location
- Package:
@shevky/plugin-rss - Main:
plugin-rss/main.js(~313 lines) - Runtime name:
shevky-rss
Lifecycle Hooks
| Hook | Implemented |
|---|---|
content:ready | ✓ |
How It Works
During content:ready:
- Reads plugin config via
ctx.config.get("shevky-rss"). - Filters
ctx.contentFilesby: validity, publication status, schema type (default:post,job-post), and optional category filter. - Groups filtered entries by language.
- For each language, builds RSS 2.0 XML with:
- Channel metadata (title, link, description, language, copyright, etc.)
- Atom self-link and alternate language feed links
- Individual items with title, link, guid, pubDate, description (CDATA), author, categories
- Writes feeds to
dist/feed.xml(default language) anddist/{lang}/feed.xml(other languages).
Configuration
Read from pluginConfigs["shevky-rss"]:
| Key | Type | Default | Description |
|---|---|---|---|
feedFilename | string | "feed.xml" | Output filename |
feedTtl | number | 1440 | Feed TTL in minutes |
feedItemCount | number | unlimited | Max items per feed |
includedSchemaTypes | string[] | ["post", "job-post"] | Schema types to include |
includedCategories | string[] | all | Optional category filter |
Dependencies
@shevky/base-i18n,plugin,format(for escaping, date formatting, URL resolution)- No external dependencies.
Risks and Limitations
- XSL stylesheet reference: Includes
<?xml-stylesheet href="/assets/rss.xsl"?>- this file must exist in the project's assets directory. - Atom namespace mixing: Uses
atom:linkwithin RSS 2.0, which is valid but non-standard. - Copyright text: Generates English or Turkish copyright text based on language detection.
Related
- Sitemap Plugin - similar content:ready pattern