From 9830055c0b8ebe5dd31083963567d16ca858d26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Fri, 14 Nov 2025 15:14:42 +0100 Subject: [PATCH] docs: add robots.txt --- docs/src/pages/robots.txt.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/src/pages/robots.txt.ts diff --git a/docs/src/pages/robots.txt.ts b/docs/src/pages/robots.txt.ts new file mode 100644 index 0000000..68176a4 --- /dev/null +++ b/docs/src/pages/robots.txt.ts @@ -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)); +}