mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
22 lines
556 B
TypeScript
22 lines
556 B
TypeScript
import type { APIRoute } from 'astro'
|
|
import { site } from '@shared/lib/site'
|
|
|
|
export const prerender = true
|
|
|
|
export const GET: APIRoute = () => {
|
|
const isProduction = (process.env.NODE_ENV || 'production') === 'production'
|
|
const sitemapUrl = `${isProduction ? site.docsUrl : ''}/sitemap.xml`
|
|
const body = `Sitemap: ${sitemapUrl}
|
|
|
|
User-agent: *
|
|
Content-Signal: search=yes, ai-input=yes, ai-train=yes
|
|
Disallow:${isProduction ? '' : ' /'}
|
|
`
|
|
|
|
return new Response(body, {
|
|
headers: {
|
|
'Content-Type': 'text/plain; charset=utf-8',
|
|
},
|
|
})
|
|
}
|