This commit is contained in:
Kar
2025-03-19 20:42:16 +05:30
commit 11eb64b5e5
44 changed files with 11825 additions and 0 deletions

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

@@ -0,0 +1,21 @@
import type { APIRoute } from 'astro';
export const GET: APIRoute = async ({ site }) => {
if (!site) {
return new Response('Site configuration error', { status: 500 });
}
const siteUrl = site.toString();
return new Response(
`User-agent: *
Allow: /
Sitemap: ${siteUrl}/sitemap.xml`,
{
headers: {
'Content-Type': 'text/plain',
},
}
);
};