add rss.xml
This commit is contained in:
parent
9ba7b9b4d4
commit
ae5e6e3ab8
5 changed files with 48 additions and 15 deletions
19
website/src/pages/rss.xml.js
Normal file
19
website/src/pages/rss.xml.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
export async function GET(context) {
|
||||
const posts = (await getCollection('blog')).filter((p) => !p.data.draft);
|
||||
const options = {
|
||||
title: 'Strudel Blog',
|
||||
description:
|
||||
'The Strudel Blog will keep you updated with the latest changes and things happening in the strudelsphere.',
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
link: `/${post.slug}/`,
|
||||
title: post.data.title,
|
||||
pubDate: post.data.date,
|
||||
description: post.data.description,
|
||||
})),
|
||||
};
|
||||
return rss(options);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue