Add SloanOps return banner to demo sites
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user