Mejora SEO

This commit is contained in:
2024-10-16 00:04:20 +02:00
parent 8dff636d94
commit b462418716
5 changed files with 89 additions and 10 deletions

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

@@ -0,0 +1,15 @@
import type { APIRoute } from 'astro';
const robotsTxt = `
User-agent: *
Allow: /
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',
},
});
};