mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: allow robots
This commit is contained in:
1 parent
b54d4a59cf
commit
b9895b1c0f
2 files changed
+15
-13
No files matched your search
@@ -22,7 +22,7 @@ env:
|
|||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
ALLOW_ROBOTS: ${{ secrets.ALLOW_ROBOTS }}
|
ALLOW_ROBOTS: true
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -5,17 +5,19 @@ export async function GET({}: APIContext) {
|
|||||||
const allowRobots = assertSecret(import.meta.env.ALLOW_ROBOTS) === 'true';
|
const allowRobots = assertSecret(import.meta.env.ALLOW_ROBOTS) === 'true';
|
||||||
const site = assertSecret(import.meta.env.SITE);
|
const site = assertSecret(import.meta.env.SITE);
|
||||||
|
|
||||||
return new Response(`
|
return new Response(
|
||||||
User-agent: *
|
`
|
||||||
${allowRobots ? 'Allow' : 'Disallow'}: /
|
User-agent: *
|
||||||
|
${allowRobots ? 'Allow' : 'Disallow'}: /
|
||||||
|
|
||||||
${
|
${
|
||||||
allowRobots
|
allowRobots
|
||||||
? `
|
? `
|
||||||
Host: ${site}
|
Host: ${site}
|
||||||
Sitemap: ${site}/sitemap-index.xml
|
Sitemap: ${site}/sitemap-index.xml
|
||||||
`
|
`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
`);
|
`.trim(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user