add RSS feed

This commit is contained in:
2026-08-22 08:25:20 -04:00
parent 0ded527b40
commit ae628ae428
3 changed files with 27 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"dependencies": { "dependencies": {
"@astrojs/check": "0.9.10", "@astrojs/check": "0.9.10",
"@astrojs/mdx": "7.0.7", "@astrojs/mdx": "7.0.7",
"@astrojs/rss": "4.0.19", "@astrojs/rss": "^4.0.19",
"@astrojs/sitemap": "3.7.3", "@astrojs/sitemap": "3.7.3",
"@astrojs/vue": "7.0.2", "@astrojs/vue": "7.0.2",
"@fontsource-variable/baskervville": "^5.2.3", "@fontsource-variable/baskervville": "^5.2.3",
+1 -1
View File
@@ -2,7 +2,7 @@
"dependencies": { "dependencies": {
"@astrojs/check": "0.9.10", "@astrojs/check": "0.9.10",
"@astrojs/mdx": "7.0.7", "@astrojs/mdx": "7.0.7",
"@astrojs/rss": "4.0.19", "@astrojs/rss": "^4.0.19",
"@astrojs/sitemap": "3.7.3", "@astrojs/sitemap": "3.7.3",
"@astrojs/vue": "7.0.2", "@astrojs/vue": "7.0.2",
"@fontsource-variable/baskervville": "^5.2.3", "@fontsource-variable/baskervville": "^5.2.3",
+25
View File
@@ -0,0 +1,25 @@
import rss from '@astrojs/rss';
import { render } from 'astro:content';
import { listPosts } from '@lib/content.ts';
export async function GET(context) {
const entries = await listPosts();
const items = await Promise.all(entries.map(async entry => {
const { remarkPluginFrontmatter } = await render(entry);
return {
title: entry.data.title,
description: remarkPluginFrontmatter.description,
link: `https://blog.jfmonty2.com/${entry.id}`,
pubDate: entry.data.date,
};
}));
return rss({
title: "Joe's Blog",
description: 'I write about stuff.',
site: 'https://blog.jfmonty2.com',
items,
});
}