feat: add robots

This commit is contained in:
2026-03-12 15:49:44 -05:00
parent 74138302a4
commit 4ef43534a0

14
src/pages/robots.txt.ts Normal file
View File

@@ -0,0 +1,14 @@
// https://docs.astro.build/en/guides/integrations-guide/sitemap/#usage
import type { APIRoute } from 'astro';
const getRobotsTxt = (sitemapURL: URL) => `\
User-agent: *
Allow: /
Sitemap: ${sitemapURL.href}
`;
export const GET: APIRoute = ({ site }) => {
const sitemapURL = new URL('sitemap-index.xml', site);
return new Response(getRobotsTxt(sitemapURL));
};