Files
blog-balodeplao/src/pages/robots.txt.ts
T
2026-03-13 11:19:35 +09:00

18 lines
355 B
TypeScript

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