initial commit
This commit is contained in:
commit
61511ed28c
28 changed files with 5210 additions and 0 deletions
18
src/pages/rss.xml.js
Normal file
18
src/pages/rss.xml.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
export async function GET(context) {
|
||||
const posts = await getCollection('blog');
|
||||
return rss({
|
||||
title: 'Terminal Blog',
|
||||
description: 'A random grassblock do some some writing work.',
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
title: post.data.title,
|
||||
description: post.data.description,
|
||||
pubDate: post.data.pubDate,
|
||||
link: `/blog/${post.slug}/`,
|
||||
content: post.body,
|
||||
})),
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue