
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
vitepress-plugin-rss
Advanced tools
English | 简体中文
install plugin via pnpm/npm/yarn
pnpm add vitepress-plugin-rss
use in .vitepress/config.ts
add basic config
import { RSSOptions, RssPlugin } from 'vitepress-plugin-rss'
const baseUrl = 'https://sugarat.top'
const RSS: RSSOptions = {
title: '粥里有勺糖',
baseUrl,
copyright: 'Copyright (c) 2018-present, 粥里有勺糖',
}
export default defineConfig({
vite: {
// ↓↓↓↓↓
plugins: [RssPlugin(RSS)]
// ↑↑↑↑↑
}
})
then run build command,you can see generate feed.rss
log after rendering pages...
pnpm run build
the rss icon is also added to page nav socialLinks.
Posts that publish: false
will not appear in the final rss file,can be used to ignore target articles
---
publish: false
---
const RSS: RSSOptions = {
// necessary(必选参数)
title: '粥里有勺糖',
baseUrl,
copyright: 'Copyright (c) 2018-present, 粥里有勺糖',
// optional(可选参数)
description: '大前端相关技术分享',
language: 'zh-cn',
author: {
name: '粥里有勺糖',
email: 'engineerzjl@foxmail.com',
link: 'https://sugarat.top'
},
icon: true,
authors: [
{
name: '粥里有勺糖',
email: 'engineerzjl@foxmail.com',
link: 'https://sugarat.top'
},
{
name: 'sugar',
email: '',
link: 'https://github.com/atqq'
}
],
filename: 'feed.rss',
log: true,
ignoreHome: true,
ignorePublish: false,
filter: (post, idx) => {
return true
}
}
support all feed Options
plugin also defines some
here is the type definition
import type { Author, FeedOptions } from 'feed'
export type RSSOptions = Omit<FeedOptions, 'id'> & {
id?: string
/**
* Filter target docs
* @param post Information related to the doc.
*/
filter?: (value: PostInfo, index: number, array: PostInfo[]) => boolean
/**
* your site address
* @example 'https://sugarat.top'
*/
baseUrl: string
/**
* online RSS address
* @default
* ```ts
* `${baseUrl + VPConfig.site.base + (filename || 'feed.rss'}`
* ```
*/
url?: string
/**
* output filename
* @default 'feed.rss'
*/
filename?: string
/**
* RSS icon display (you can also pass in an svg string to customize, the SVG icon can be obtained by visiting https://www.xicons.org/#)
* @default true
*/
icon?: boolean | string
/**
* Whether to print process prompts
* @default true
*/
log?: boolean
/**
* Whether to filter layout:home
* @default true
*/
ignoreHome?: boolean
/**
* Whether to ignore frontmatter publish control
* @default false
*/
ignorePublish?: boolean
/**
* List of authors involved in blog site content
*/
authors?: Author[]
/**
* Customize doc summary generation logic
*/
renderExpect?: (
fileContent: string,
frontmatter: Record<string, any>
) => string | Promise<string>
/**
* Limit the number of docs the output file contains
* @default 0
* @description (0 no limit; > 1 will adjust the output content according to date sorting)
*/
limit?: number
/**
* Manually control the logic for generating HTML, or not use vitepress' built-in HTML rendering logic
* @default true
*/
renderHTML?: ((filecontent: string) => string | Promise<string>) | boolean
/**
* i18n
*/
locales?: Record<string, Omit<RSSOptions, 'locales'>>
}
Using Nginx as an example, you can add the following configuration
location ~ \.rss$ {
charset utf-8;
}
FAQs
vitepress plugin, generate feed.rss
The npm package vitepress-plugin-rss receives a total of 321 weekly downloads. As such, vitepress-plugin-rss popularity was classified as not popular.
We found that vitepress-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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.