Initial Commit

This commit is contained in:
RiseForever
2026-08-11 10:25:27 +08:00
parent 70d33c0996
commit cd5e2796c2
161 changed files with 29688 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
import rss from '@astrojs/rss';
import { siteConfig } from '@/site.config';
import { getExcerpt, getPostPath, getPublicPosts } from '@/lib/content';
import { renderMarkdown } from '@/lib/shortcodes';
export async function GET(context) {
const posts = (await getPublicPosts()).slice(0, 10);
return rss({
title: siteConfig.site.title,
description: siteConfig.site.description,
site: context.site,
items: posts.map((post) => ({
title: post.data.title,
description: getExcerpt(post),
content: renderMarkdown(post.body ?? ''),
pubDate: post.data.pubDate,
link: getPostPath(post)
}))
});
}