Skip to content

Commit 533d177

Browse files
committed
feat: add RSS feed generation for Vercord Documentation
- Implemented a new RSS feed feature in rss.ts to enhance content distribution. - Utilized the 'feed' library to create a structured RSS feed with documentation pages. - Included metadata such as title, link, and author information for each feed item.
1 parent 64a0c81 commit 533d177

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

apps/fumadocs/src/lib/rss.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Feed } from "feed";
2+
import { source } from "@/lib/source";
3+
4+
const baseUrl = "https://fumadocs.dev";
5+
6+
export function getRSS() {
7+
const feed = new Feed({
8+
title: "Vercord Documentation",
9+
id: `${baseUrl}/docs`,
10+
link: `${baseUrl}/docs`,
11+
language: "en",
12+
image: `${baseUrl}/banner.png`,
13+
favicon: `${baseUrl}/icon.png`,
14+
copyright: "All rights reserved 2025, Vercord",
15+
});
16+
17+
for (const page of source.getPages()) {
18+
feed.addItem({
19+
id: page.url,
20+
title: page.data.title,
21+
description: page.data.description,
22+
link: `${baseUrl}${page.url}`,
23+
date: new Date(),
24+
25+
author: [
26+
{
27+
name: "kWAY",
28+
},
29+
],
30+
});
31+
}
32+
33+
return feed.rss2();
34+
}

0 commit comments

Comments
 (0)