init: astro publish site with newsletter, search, and actions workflow
Some checks failed
deploy / build-and-deploy (push) Has been cancelled

This commit is contained in:
voson
2026-02-03 10:49:10 +08:00
commit 54109dd5b2
45 changed files with 10452 additions and 0 deletions

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

@@ -0,0 +1,16 @@
import { getCollection } from 'astro:content';
import rss from '@astrojs/rss';
import { SITE_DESCRIPTION, SITE_TITLE } 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}/`,
})),
});
}