add RSS feed
This commit is contained in:
@@ -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
@@ -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",
|
||||||
|
|||||||
@@ -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,
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user