2024-02-13 05:50:53 +04:00
|
|
|
// https://docs.astro.build/en/guides/integrations-guide/sitemap/#usage
|
2024-02-12 07:37:22 +04:00
|
|
|
import type { APIRoute } from 'astro';
|
|
|
|
|
|
|
|
|
|
const robotsTxt = `
|
2024-02-19 10:05:50 +04:00
|
|
|
User-agent: Googlebot
|
|
|
|
|
Disallow:
|
|
|
|
|
Allow: /
|
|
|
|
|
Crawl-delay: 10
|
|
|
|
|
|
|
|
|
|
User-agent: Yandex
|
|
|
|
|
Disallow:
|
2024-02-12 07:37:22 +04:00
|
|
|
Allow: /
|
2024-02-19 10:05:50 +04:00
|
|
|
Crawl-delay: 2
|
|
|
|
|
|
|
|
|
|
User-agent: archive.org_bot
|
|
|
|
|
Disallow:
|
|
|
|
|
Allow: /
|
|
|
|
|
Crawl-delay: 2
|
|
|
|
|
|
|
|
|
|
User-agent: *
|
|
|
|
|
Disallow: /
|
2024-02-12 07:37:22 +04:00
|
|
|
|
|
|
|
|
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',
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|