import { pages, posts } from '@/helpers/schema'; import { urlJoin } from '@/helpers/tools'; export const prerender = true; export const GET = async () => { const result = ` ${import.meta.env.SITE}/ ${posts .map((post) => { return `${urlJoin(import.meta.env.SITE, post.permalink)}${post.date.toISOString()}`; }) .join('\n')} ${pages .map((page) => { return `${urlJoin(import.meta.env.SITE, page.permalink)}${page.date.toISOString()}`; }) .join('\n')} `.trim(); return new Response(result, { headers: { 'Content-Type': 'application/xml', }, }); };