Initial commit

This commit is contained in:
Atridad Lahiji
2023-04-20 04:20:00 -06:00
committed by Atridad Lahiji
commit 84591f3a2d
23 changed files with 4795 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.slug}/`,
})),
});
}