diff --git a/scripts/verify.ts b/scripts/verify.ts index 6dde040b..c80f5981 100644 --- a/scripts/verify.ts +++ b/scripts/verify.ts @@ -167,7 +167,7 @@ async function checkSitemap(): Promise { const locs = [...r.body.matchAll(/([^<]+)<\/loc>/g)].flatMap((m) => m[1] ? [m[1]] : [] ); - const required = ["/", "/blog"]; + const required = ["/", "/blog", "/faq"]; const paths = locs.map((l) => l.replace(/^https?:\/\/[^/]+/, "") || "/"); const missing = required.filter((p) => !paths.includes(p)); if (missing.length > 0) { @@ -326,6 +326,25 @@ async function checkRoute( } } + // FAQPage schema on /faq, with one Question per heading + if (path === "/faq") { + const ld = jsonLd(r.body); + const faq = ld.ok + ? ld.blocks.find((b) => b["@type"] === "FAQPage") + : undefined; + const questions = Array.isArray(faq?.mainEntity) + ? faq.mainEntity.length + : 0; + const headings = (r.body.match(/ +