Add SloanOps return banner to demo sites

This commit is contained in:
Kevin
2026-09-03 10:41:48 -04:00
parent f56cf5e10e
commit dec4d22d46
3 changed files with 110 additions and 0 deletions
+5
View File
@@ -12,6 +12,7 @@ const pages = await Promise.all(required.filter((file) => file.endsWith('.html')
for (const { file, html } of pages) {
if (html.includes('{{') || html.includes('{%')) throw new Error(`${file} contains an unresolved template placeholder.`);
if (!/<title>[^<]+<\/title>/.test(html)) throw new Error(`${file} is missing a title.`);
if (!html.includes('data-demo-banner') || !html.includes('href="https://sloanops.com/"')) throw new Error(`${file} is missing the SloanOps demo banner.`);
for (const match of html.matchAll(/(?:src|href)="(\/images\/[^"?#]+)"/g)) await access(resolve(root, `.${match[1]}`));
}
@@ -27,6 +28,10 @@ if (key === 'www') {
if (key === 'blog') {
const publishedPosts = ['first-walk-after-work', 'gentler-grooming-day', 'overnight-care-checklist', 'weekend-care-prep'];
await Promise.all(publishedPosts.map((slug) => access(resolve(root, `posts/${slug}/index.html`))));
for (const slug of publishedPosts) {
const html = await readFile(resolve(root, `posts/${slug}/index.html`), 'utf8');
if (!html.includes('data-demo-banner') || !html.includes('href="https://sloanops.com/"')) throw new Error(`Blog post is missing the SloanOps demo banner: ${slug}.`);
}
if (home.includes('Draft only example for editorial review')) throw new Error('Draft blog post appeared in the journal.');
try {
await access(resolve(root, 'posts/draft-only-example/index.html'));