import { NextResponse } from 'next/server' import { SITE_URL } from '@/lib/core/utils/urls' import { getAllPostMeta } from '@/lib/library/registry' export const revalidate = 3600 export async function GET() { const posts = await getAllPostMeta() const base = SITE_URL const xml = ` ${posts .map( (p) => ` ${p.canonical} ${p.ogImage.startsWith('http') ? p.ogImage : `${base}${p.ogImage}`} ` ) .join('\n')} ` return new NextResponse(xml, { headers: { 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate=86400', }, }) }