2026-03-02T08-42-04_auto_memory/memories.db-wal

This commit is contained in:
Nicholai Vogel 2026-03-02 01:42:04 -07:00
parent 13a55b1df5
commit 13ff2229f3
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
import { SITE_TITLE, SITE_DESCRIPTION, SITE_URL } from "@/consts";
import type { APIContext } from "astro";
export const prerender = true;
export async function GET(context: APIContext) {
const posts = await getCollection("blog");
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site ?? SITE_URL,
items: posts
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf())
.map((post) => ({
title: post.data.title,
pubDate: post.data.pubDate,
description: post.data.description,
link: `/blog/${post.id}/`,
})),
});
}

Binary file not shown.