Files
fuwari/src/pages/robots.txt.ts
Joey Chen 174c5d8efc
Some checks failed
Code quality / quality (push) Failing after 4s
Build and Check / Astro Check for Node.js 22 (push) Failing after 5s
Build and Check / Astro Check for Node.js 23 (push) Failing after 3s
Build and Check / Astro Build for Node.js 22 (push) Failing after 3s
Build and Check / Astro Build for Node.js 23 (push) Failing after 3s
fix: disallow crawling from /_astro/ (#399)
* fix: disallow crawling from `/_astro/`

* fix: add missing newline at end of robots.txt.ts file

---------

Co-authored-by: Joey Chen <JoeyC-Dev@users.noreply.github.com>
Co-authored-by: L4Ph <4ranci0ne@gmail.com>
2025-04-15 18:28:24 +09:00

17 lines
318 B
TypeScript

import type { APIRoute } from "astro";
const robotsTxt = `
User-agent: *
Disallow: /_astro/
Sitemap: ${new URL("sitemap-index.xml", import.meta.env.SITE).href}
`.trim();
export const GET: APIRoute = () => {
return new Response(robotsTxt, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
},
});
};