fix: make rss.xml file statically-generated

This commit is contained in:
Dorian Niemiec 2024-09-08 12:28:53 +02:00
parent fb48d4232d
commit ae6cc2ff44
2 changed files with 3 additions and 0 deletions

View file

@ -46,6 +46,7 @@ export async function POST(req: NextRequest) {
if (body.slug.current) {
revalidatePath(`/blog/${body.slug.current}`);
revalidatePath("/sitemap.xml");
revalidatePath("/rss.xml");
}
revalidatePath("/blog");

View file

@ -3,6 +3,8 @@ import RSS from "rss";
import { client } from "@/lib/sanity";
import { toHTML } from "@portabletext/to-html";
export const dynamic = "force-static";
export async function GET() {
// Define the site URL based on the environment
const SITE_URL =