
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@cogita/plugin-rss
Advanced tools
RSS, Atom, and JSON Feed generation plugin for Cogita blogs, providing comprehensive subscription support with automatic HTML discovery links.
中文 | English
RSS, Atom, and JSON Feed generation plugin for Cogita blogs with automatic HTML discovery links.
This plugin automatically generates RSS 2.0, Atom, and JSON Feed files from your blog posts and adds discovery links to HTML pages. It's perfect for readers who want to subscribe to your blog updates.
✅ Multiple Feed Formats
✅ SEO Optimized
<link> tag injection✅ Highly Configurable
✅ Zero Configuration
pnpm add @cogita/plugin-rss
Note: This plugin depends on
@cogita/plugin-posts-frontmatterto access post data.
The plugin will be automatically included by themes that support it:
// cogita.config.ts
import { defineConfig } from '@cogita/core';
export default defineConfig({
site: {
title: 'My Blog',
description: 'Sharing my thoughts',
url: 'https://myblog.com'
},
theme: 'lucid' // Theme will auto-load RSS plugin
});
// cogita.config.ts
import { defineConfig } from '@cogita/core';
import { pluginRSS } from '@cogita/plugin-rss';
export default defineConfig({
plugins: [
pluginRSS({
title: 'My Blog RSS',
description: 'Latest posts from my blog',
link: 'https://myblog.com',
formats: ['rss', 'atom', 'json']
})
]
});
interface RSSConfig {
// Required
title: string; // Feed title
description: string; // Feed description
link: string; // Website URL
// Optional
language?: string; // Default: 'zh-CN'
copyright?: string; // Copyright notice
managingEditor?: string; // Editor email
webMaster?: string; // Webmaster email
// Output options
formats?: ('rss' | 'atom' | 'json')[]; // Default: ['rss']
feedPath?: string; // Default: 'rss.xml'
atomPath?: string; // Default: 'atom.xml'
jsonPath?: string; // Default: 'feed.json'
// Content options
maxItems?: number; // Default: 20
includeContent?: boolean; // Default: false
// Field mapping
customFields?: {
author?: string; // Frontmatter field name
category?: string; // Frontmatter field name
};
}
pluginRSS({
title: 'Tech Blog',
description: 'Latest technology articles',
link: 'https://techblog.com'
})
pluginRSS({
title: 'My Blog',
description: 'Personal blog updates',
link: 'https://myblog.com',
formats: ['rss', 'atom', 'json'],
feedPath: 'feeds/rss.xml',
atomPath: 'feeds/atom.xml',
jsonPath: 'feeds/feed.json',
maxItems: 50
})
pluginRSS({
title: 'Developer Blog',
description: 'Software development insights',
link: 'https://devblog.com',
customFields: {
author: 'writer', // Use 'writer' field from frontmatter
category: 'topics' // Use 'topics' field as categories
}
})
The plugin generates the following files:
/rss.xml - RSS 2.0 feed (if enabled)/atom.xml - Atom feed (if enabled)/feed.json - JSON Feed (if enabled)The plugin automatically adds discovery links to your HTML:
<head>
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/rss.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="/atom.xml" />
<link rel="alternate" type="application/json" title="JSON Feed" href="/feed.json" />
</head>
The plugin works with standard frontmatter fields:
---
title: "My First Post"
description: "An introduction to my blog"
date: "2024-01-15"
author: "John Doe"
categories: ["tech", "blog"]
tags: ["introduction", "welcome"]
---
Access feed metadata in your components:
// Available in theme components
import { feedMeta } from 'virtual-rss-meta';
function FeedLinks() {
return (
<div>
{feedMeta.rssUrl && <a href={feedMeta.rssUrl}>RSS</a>}
{feedMeta.atomUrl && <a href={feedMeta.atomUrl}>Atom</a>}
{feedMeta.jsonUrl && <a href={feedMeta.jsonUrl}>JSON</a>}
</div>
);
}
Full TypeScript support with exported types:
import type { RSSConfig, FeedMeta } from '@cogita/plugin-rss';
@cogita/plugin-posts-frontmatter is loaded firstlink configuration is correctSee the plugin design document for detailed architecture and more examples.
MIT License. See LICENSE for details.
Contributions welcome! Please read our Contributing Guide.
FAQs
RSS, Atom, and JSON Feed generation plugin for Cogita blogs, providing comprehensive subscription support with automatic HTML discovery links.
We found that @cogita/plugin-rss demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.