diff --git a/src/pages/feeds/all.xml.js b/src/pages/feeds/all.xml.js index b76fb40..80ce914 100644 --- a/src/pages/feeds/all.xml.js +++ b/src/pages/feeds/all.xml.js @@ -4,7 +4,7 @@ import { fetchActivity } from "@utils/data/activity.js"; export const prerender = true; -export async function getStaticPaths() { +export async function GET() { const globals = await fetchGlobals(); const activity = await fetchActivity(); @@ -19,5 +19,10 @@ export async function getStaticPaths() { await fs.mkdir(path.dirname(filePath), { recursive: true }); await fs.writeFile(filePath, rss); - return []; + return new Response(rss, { + status: 200, + headers: { + "Content-Type": "application/rss+xml", + }, + }); } diff --git a/src/pages/feeds/books.xml.js b/src/pages/feeds/books.xml.js index a1007db..e516410 100644 --- a/src/pages/feeds/books.xml.js +++ b/src/pages/feeds/books.xml.js @@ -4,7 +4,7 @@ import { fetchBooks } from "@utils/data/books.js"; export const prerender = true; -export async function getStaticPaths() { +export async function GET() { const globals = await fetchGlobals(); const books = await fetchBooks(); @@ -19,5 +19,10 @@ export async function getStaticPaths() { await fs.mkdir(path.dirname(filePath), { recursive: true }); await fs.writeFile(filePath, rss); - return []; + return new Response(rss, { + status: 200, + headers: { + "Content-Type": "application/rss+xml", + }, + }); } diff --git a/src/pages/feeds/links.xml.js b/src/pages/feeds/links.xml.js index b99b76b..f083bcc 100644 --- a/src/pages/feeds/links.xml.js +++ b/src/pages/feeds/links.xml.js @@ -4,7 +4,7 @@ import { fetchLinks } from "@utils/data/links"; export const prerender = true; -export async function getStaticPaths() { +export async function GET() { const globals = await fetchGlobals(); const links = await fetchLinks(); @@ -19,5 +19,10 @@ export async function getStaticPaths() { await fs.mkdir(path.dirname(filePath), { recursive: true }); await fs.writeFile(filePath, rss); - return []; + return new Response(rss, { + status: 200, + headers: { + "Content-Type": "application/rss+xml", + }, + }); } diff --git a/src/pages/feeds/movies.xml.js b/src/pages/feeds/movies.xml.js index 6924745..7b6b482 100644 --- a/src/pages/feeds/movies.xml.js +++ b/src/pages/feeds/movies.xml.js @@ -8,7 +8,7 @@ export async function getStaticPaths() { const globals = await fetchGlobals(); const movies = await fetchMovies(); - const rss = generateRssFeed({ + const rss = GET({ permalink: "/feeds/movies.xml", title: "Movies feed", globals, @@ -19,5 +19,10 @@ export async function getStaticPaths() { await fs.mkdir(path.dirname(filePath), { recursive: true }); await fs.writeFile(filePath, rss); - return []; + return new Response(rss, { + status: 200, + headers: { + "Content-Type": "application/rss+xml", + }, + }); } diff --git a/src/pages/feeds/posts.xml.js b/src/pages/feeds/posts.xml.js index 7b30949..7a757ab 100644 --- a/src/pages/feeds/posts.xml.js +++ b/src/pages/feeds/posts.xml.js @@ -8,7 +8,7 @@ export async function getStaticPaths() { const globals = await fetchGlobals(); const posts = await fetchAllPosts(); - const rss = generateRssFeed({ + const rss = GET({ permalink: "/feeds/posts.xml", title: "Posts feed", globals, @@ -19,5 +19,10 @@ export async function getStaticPaths() { await fs.mkdir(path.dirname(filePath), { recursive: true }); await fs.writeFile(filePath, rss); - return []; + return new Response(rss, { + status: 200, + headers: { + "Content-Type": "application/rss+xml", + }, + }); }