2023-12-10 02:28:43 +01:00
|
|
|
import rss from '@astrojs/rss';
|
|
|
|
import { getCollection } from 'astro:content';
|
|
|
|
|
|
|
|
export async function GET(context) {
|
|
|
|
const blog = await getCollection('blog');
|
|
|
|
return rss({
|
2024-11-30 18:17:34 +01:00
|
|
|
title: 'sidski',
|
|
|
|
description: 'Recent content on sidski`s blog',
|
2023-12-10 02:28:43 +01:00
|
|
|
site: context.site,
|
|
|
|
items: blog.map((post) => ({
|
|
|
|
title: post.data.title,
|
|
|
|
pubDate: post.data.pubDate,
|
|
|
|
description: post.data.description,
|
|
|
|
customData: post.data.customData,
|
|
|
|
link: `/blog/${post.slug}/`,
|
|
|
|
})),
|
2023-12-17 23:11:29 +01:00
|
|
|
source: {
|
2024-11-30 18:17:34 +01:00
|
|
|
title: 'sidski',
|
2023-12-17 23:11:29 +01:00
|
|
|
url: 'http://kjelsrud.dev/rss.xml',
|
|
|
|
},
|
|
|
|
enclosure: {
|
|
|
|
url: '/public'
|
|
|
|
},
|
2023-12-10 02:28:43 +01:00
|
|
|
});
|
|
|
|
}
|