upgrade to astro 5

This commit is contained in:
2024-12-12 19:48:23 -05:00
parent 937b66e7c0
commit 3af9574c6d
11 changed files with 240 additions and 512 deletions
+2 -3
View File
@@ -1,10 +1,9 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import sanitizeHtml from 'sanitize-html';
import MarkdownIt from 'markdown-it';
const parser = new MarkdownIt({ html: true });
export async function get(context) {
export async function GET(context) {
const blog = await getCollection('blog');
return rss({
title: 'ghall.blog',
@@ -19,7 +18,7 @@ export async function get(context) {
pubDate: post.data.pubDate,
link: `/posts/${post.slug}`,
categories: post.data.tags,
content: sanitizeHtml(parser.render(post.body)),
content: parser.render(post.body),
})),
});
}