Update to Astro v3

This commit is contained in:
prototypa
2023-08-22 18:19:53 -04:00
parent d36f60218b
commit 53e12771bd
7 changed files with 34 additions and 27 deletions

View File

@ -4,7 +4,7 @@ import { SITE_CONFIG, METADATA_CONFIG, APP_BLOG_CONFIG } from '~/utils/config';
import { fetchPosts } from '~/utils/blog';
import { getPermalink } from '~/utils/permalinks';
export const get = async () => {
export const GET = async () => {
if (!APP_BLOG_CONFIG.isEnabled) {
return new Response(null, {
status: 404,
@ -14,7 +14,7 @@ export const get = async () => {
const posts = await fetchPosts();
return rss({
const { body = "" } = await rss({
title: `${SITE_CONFIG.name}s Blog`,
description: METADATA_CONFIG?.description || "",
site: import.meta.env.SITE,
@ -27,5 +27,12 @@ export const get = async () => {
})),
trailingSlash: SITE_CONFIG.trailingSlash,
})
return new Response(body, {
status: 200,
headers: {
"Content-Type": "application/xml"
}
});
};