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
+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,
});
}