import type { APIRoute } from 'astro'; /** * robots.txt, generated from `site` in astro.config.mjs so the Sitemap line * always matches the deployed origin — nothing to keep in sync by hand. The * catalog is public reference material, so everything is crawlable. */ export const GET: APIRoute = ({ site }) => { const sitemap = site ? new URL('sitemap-index.xml', site).href : '/sitemap-index.xml'; const body = `User-agent: * Allow: / Sitemap: ${sitemap} `; return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8' }, }); };