Populates the project with the blog template

This commit is contained in:
2025-06-03 11:08:59 -07:00
parent e136eb8381
commit 0c4a8a1ddf
35 changed files with 6895 additions and 0 deletions

16
src/pages/rss.xml.js Normal file
View File

@@ -0,0 +1,16 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
export async function GET(context) {
const posts = await getCollection('blog');
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site,
items: posts.map((post) => ({
...post.data,
link: `/blog/${post.id}/`,
})),
});
}