const fs = require("fs"); function read(path) { return fs.readFileSync(path, "utf8"); } function assert(condition, message) { if (!condition) throw new Error(message); } const robots = read("robots.txt"); const sitemap = read("sitemap.xml"); const index = read("html/index.html"); const article = read("html/mianfei.html"); const commonUtil = read("utils/CommonUtil.js"); assert(!robots.includes("3d.3dyjs.cn"), "robots should not reference the old domain"); assert(!sitemap.includes("3d.3dyjs.cn"), "sitemap should not reference the old domain"); assert( robots.includes("Sitemap: https://www.scs8888.cn/sitemap.xml"), "robots should advertise the production sitemap", ); const sitemapLocations = Array.from(sitemap.matchAll(/([^<]+)<\/loc>/g), (match) => match[1]); assert(sitemapLocations.length === 1, "static sitemap should contain only the confirmed homepage"); assert( sitemapLocations[0] === "https://www.scs8888.cn/", "static sitemap homepage should use the canonical production origin", ); [ "login", "reg", "usercenter", "chongzhi", "tixian", "fabumianfeiwenzhang", "fufei", ].forEach((privateRoute) => { assert(!sitemap.includes(privateRoute), `private route must not appear in sitemap: ${privateRoute}`); }); assert(/神彩算彩票数据分析与免费预测文章'), "homepage crawlable H1 missing", ); assert( index.includes("开奖数据、走势分析和免费文章"), "homepage crawlable site description missing", ); assert(/ { assert(deploymentDoc.includes(requiredText), `deployment handoff missing: ${requiredText}`); }); console.log("SEO indexing checks passed");