the validationlab.eu marketing site: 3 audience pages (en) + legal skeletons, i18n scaffold (25 locales, subdirectory scheme), structured frontmatter blocks, Zoho Flow lead forms with capability tagging + honeypot, sitemap/hreflang/JSON-LD/robots, cookie-gated analytics plumbing
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Dev lint: page frontmatter must parse AND no unquoted scalar may carry a
|
||||
// ": " sequence (the YAML plain-scalar killer found live twice today).
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
let bad = 0;
|
||||
for (const f of fs.readdirSync("src/pages").filter((x) => x.endsWith(".md"))) {
|
||||
const fm = fs.readFileSync("src/pages/" + f, "utf8").match(/^---\n([\s\S]*?)\n---\n/)[1];
|
||||
fm.split("\n").forEach((l, i) => {
|
||||
const m = l.match(/^(\s*[\w_]+:)( .*)$/);
|
||||
if (m && !/^["'&*[\]|>@]/.test(m[2].trim()) && m[2].includes(": ")) {
|
||||
console.log(`${f}:${i + 1} UNQUOTED COLON: ${m[2].trim().slice(0, 90)}`);
|
||||
bad++;
|
||||
}
|
||||
});
|
||||
try {
|
||||
yaml.load(fm);
|
||||
} catch (e) {
|
||||
console.log(`${f}: PARSE-ERROR: ${e.reason}`);
|
||||
bad++;
|
||||
}
|
||||
}
|
||||
console.log(bad ? `${bad} problems` : "ALL FRONTMATTER CLEAN");
|
||||
Reference in New Issue
Block a user