Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
fix(blog): allow Guides directory in footer build validation
Guse61bc9f722ca
diff --git a/src/web/blog/README.md b/src/web/blog/README.mdindex bddc4e578..bf0313826 100644--- a/src/web/blog/README.md+++ b/src/web/blog/README.md@@ -45,7 +45,7 @@ export const metadata = {Continue registering the article once in `src/lib/blog/topics.ts` for its category. Guides reuses those categories and the existing `/blog/<slug>` article URL, author/date display, images and reading template. Missing tags keeps old articles in the main Blog; other tags alone do not move an article. Do not retag existing posts without an editorial decision.-The tag excludes an article from the main Blog list and RSS, Keep exploring and Next Blog. Never add Guides or its articles to the main Blog footer navigation. Readers find guides through `/guides`, direct/search links and relevant editorial body links. A guide's back/category links return to `/guides`. It remains in the existing discovery manifest and sitemap, with its own original canonical URL; **do not add noindex merely because it is absent from the main list**. Drafts remain private.+The tag excludes an article from the main Blog list and RSS, Keep exploring and Next Blog. The Blog footer links to the `/guides` directory; do not add individual guide articles to footer navigation. Readers find guides through that directory, direct/search links and relevant editorial body links. A guide's back/category links return to `/guides`. It remains in the existing discovery manifest and sitemap, with its own original canonical URL; **do not add noindex merely because it is absent from the main list**. Drafts remain private.## Images and sharing@@ -67,7 +67,7 @@ pnpm --filter @alook/web build:blogThis includes source validation, image preparation, Next compilation, and rendered article validation before Worker packaging. `build:blog:next` is the internal Next/standalone preparation step used by that command. `validate:blog` alone checks source files; it is not the full publishing gate.-Build errors include missing/invalid required metadata, invalid optional SEO title, duplicate H1 in Markdown, invalid/missing/oversized source images; then, in rendered articles: missing body/title/description, a missing or extra H1, incorrect canonical, noindex, duplicate heading IDs, conflicting/unparseable BlogPosting JSON-LD, missing local article/fragment/image resources, and inconsistent image or OG dimensions. Generated responsive resources must exist. Drafts must not become prerendered public articles. The full published article set must match topics and the discovery manifest (which supplies the main site sitemap). The main index and RSS contain only articles without the `guides` tag; `/guides` contains only articles with that tag. Their two index sets must partition the published articles. Footer navigation and Keep exploring / Next Blog recommendations must not expose Guides.+Build errors include missing/invalid required metadata, invalid optional SEO title, duplicate H1 in Markdown, invalid/missing/oversized source images; then, in rendered articles: missing body/title/description, a missing or extra H1, incorrect canonical, noindex, duplicate heading IDs, conflicting/unparseable BlogPosting JSON-LD, missing local article/fragment/image resources, and inconsistent image or OG dimensions. Generated responsive resources must exist. Drafts must not become prerendered public articles. The full published article set must match topics and the discovery manifest (which supplies the main site sitemap). The main index and RSS contain only articles without the `guides` tag; `/guides` contains only articles with that tag. Their two index sets must partition the published articles. Footer navigation may link to the `/guides` directory, but must not link to individual guide articles. Keep exploring / Next Blog recommendations must not include the Guides directory or guide articles.The existing topic tests compare published MDX and the topic registry in both directions. Run related tests when changing templates or publication behavior; negative fixtures must demonstrate that invalid output actually fails. Keep `image-assets.json` regenerated with any source-image change so a clean checkout can typecheck before its first build.diff --git a/src/web/blog/scripts/validate-rendered.test.ts b/src/web/blog/scripts/validate-rendered.test.tsindex 5ed37f86c..33a00fd17 100644--- a/src/web/blog/scripts/validate-rendered.test.ts+++ b/src/web/blog/scripts/validate-rendered.test.ts@@ -89,8 +89,13 @@ describe("Blog build gate", () => {expect(() => validateBlogBuild(root)).not.toThrow();put(".next/server/app/blog/example.html", html + '<aside data-blog-recommendations><a href="/blog/example">Guide</a></aside>');expect(() => validateBlogBuild(root)).toThrow("Guides leaked");- put(".next/server/app/blog/example.html", html + '<footer><a href="/guides">Guides</a></footer>');+ put(".next/server/app/blog/example.html", html + '<footer><a href="/blog/example">Guide article</a></footer>');+ expect(() => validateBlogBuild(root)).toThrow("Guides leaked");+ put(".next/server/app/blog/example.html", html + '<aside data-blog-recommendations><a href="/guides">Guides</a></aside>');expect(() => validateBlogBuild(root)).toThrow("Guides leaked");+ put(".next/server/app/blog/example.html", html + '<footer><a href="/guides">Guides</a></footer>');+ put(".next/server/app/blog.html", '<h1>Blog</h1><footer><a href="/guides">Guides</a></footer>');+ expect(() => validateBlogBuild(root)).not.toThrow();put(".next/server/app/blog/example.html", html);put("src/content/draft.mdx", source({ ...metadata, slug: "draft", draft: true }));expect(() => validateBlogBuild(root)).not.toThrow();diff --git a/src/web/blog/scripts/validate-rendered.ts b/src/web/blog/scripts/validate-rendered.tsindex f620c18b6..a04507af5 100644--- a/src/web/blog/scripts/validate-rendered.ts+++ b/src/web/blog/scripts/validate-rendered.ts@@ -117,7 +117,7 @@ export function validateBlogBuild(blogRoot: string): void {const doc = new JSDOM(html).window.document;for (const link of doc.querySelectorAll<HTMLAnchorElement>('footer a[href], [data-blog-recommendations] a[href]')) {const url = new URL(link.getAttribute("href")!, origin);- if (url.origin === origin && (/^\/guides\/?$/.test(url.pathname) || guideSlugs.some((slug) => url.pathname.replace(/\/$/, "") === `/blog/${slug}`))) {+ if (url.origin === origin && ((link.closest("[data-blog-recommendations]") && /^\/guides\/?$/.test(url.pathname)) || guideSlugs.some((slug) => url.pathname.replace(/\/$/, "") === `/blog/${slug}`))) {throw new Error("Guides leaked into Blog footer or recommendations");}}