import type { APIRoute } from 'astro'; /** * `/robots.txt` (D49, phase 10). * * The site had a sitemap covering all fifty URLs โ€” Starlight bundles `@astrojs/sitemap`, so * it has been written on every build since phase 1 โ€” and nothing that pointed at it. A * crawler finds a sitemap two ways: submitted by hand in a search console, or named here. * There is no search console for this project (D9's no-analytics posture extends to not * having accounts with anyone), so this file is the only way it is ever found. * * **Everything is allowed.** The site has no authenticated surface at all (ยง6), so there is * no private area to keep out of an index, and the two exclusions worth arguing about were * both rejected: * * - `/brand/*` is derived images and a stylesheet. Nothing links them as pages and they * carry no text; disallowing them would only stop an image crawler fetching the OG card * that exists to be fetched. * - `/beta/` is a live page a person is meant to find. It is the closed test's front door * and the nearest real deadline this project has โ€” hiding it from search to keep the * signup list small would be solving a problem nobody has. * * The 404 page is excluded from the *search index* instead (`data-pagefind-ignore`), which * is the right layer for it: it is never a URL a crawler is given. * * Written as a route rather than a file in `public/` so the sitemap URL is derived from * `site` in `astro.config.mjs`. A hand-written copy would be one more place the domain is * spelled out, and the first thing to go stale if it ever changes. */ export const GET: APIRoute = ({ site }) => new Response( [ 'User-agent: *', 'Allow: /', '', `Sitemap: ${new URL('sitemap-index.xml', site)}`, '', ].join('\n'), { headers: { 'Content-Type': 'text/plain; charset=utf-8' } } );