upgrade to astro 2.0

This commit is contained in:
2023-01-31 21:42:01 -05:00
parent d780cf085d
commit 4a8cb8bb32
30 changed files with 1291 additions and 1206 deletions
+23
View File
@@ -0,0 +1,23 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
export async function get(context) {
const blog = await getCollection("blog");
console.log(blog);
return rss({
title: "ghall.blog",
description:
"My personal blog about life, gaming, tech, and whatever else I feel like writing about.",
site: "https://ghall.blog",
items: blog
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
.map((post) => ({
title: post.data.title,
pubDate: post.data.pubDate,
// description: post.body,
// Compute RSS link from post `slug`
// This example assumes all posts are rendered as `/blog/[slug]` routes
link: `/posts/${post.slug}/`,
})),
});
}