docs: add robots.txt

This commit is contained in:
Maël Gangloff
2025-11-14 15:14:42 +01:00
parent d244ec7980
commit 9830055c0b

View File

@@ -0,0 +1,13 @@
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));
}