Add disable_seo config to keep preview deployments out of search engines

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-15 05:29:08 +01:00
co-authored by Claude Opus 5.5
parent 3a75880ae4
commit 23a309005a
14 changed files with 117 additions and 3 deletions
+4
View File
@@ -18,6 +18,10 @@ export default function () {
const { ROOT_DIR, PUBLIC_DIR } = grabDirNames();
global.BUNEXT_CONFIG = (await grabConfig()) || {};
global.BUNEXT_CONSTANTS = grabConstants();
if (global.BUNEXT_CONFIG.disable_seo) {
log.warn(`\`disable_seo\` is set: the server blocks all crawlers at ` +
`/robots.txt, so the generated robots.txt is not served.`);
}
const { output, chunk_size, chunks_dir, ...sitemap_config } = global.BUNEXT_CONFIG.sitemap || {};
if (!existsSync(grabPageLastmodFile(sitemap_config.lastmod_file))) {
log.warn(`No page lastmod record found. Run \`bunext build\` first ` +