initial commit

This commit is contained in:
grassblock 2025-05-01 16:53:18 +08:00
commit 61511ed28c
28 changed files with 5210 additions and 0 deletions

18
src/pages/rss.xml.js Normal file
View 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,
})),
});
}