feat: sitemap

This commit is contained in:
TrèsAbhi committed 2024-10-14 10:52:40 -05:00
1 parent dfc55b745b
commit 5a5643ce3d
5 files changed
+17 -12

No files matched your search

@@ -41,6 +41,7 @@ const isRoot = pathname === '/';
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="sitemap" href="/sitemap-index.xml" />
<Party3 />
</head>
+12 -11
View File
@@ -3,18 +3,19 @@ import type { APIContext } from 'astro';
export async function GET({}: APIContext) {
const allowRobots = assertSecret(import.meta.env.ALLOW_ROBOTS) === 'true';
const site = assertSecret(import.meta.env.SITE);
return new Response(`
User-agent: *
${allowRobots ? 'Allow' : 'Disallow'}: /
User-agent: *
${allowRobots ? 'Allow' : 'Disallow'}: /
${
allowRobots
? `
Host: https://blitzkit.app
Sitemap: https://blitzkit.app/sitemap.txt
`
: ''
}
`);
${
allowRobots
? `
Host: ${site}
Sitemap: ${site}/sitemap-index.xml
`
: ''
}
`);
}