syntaxai/tdd.md · commit 85d5449

Add /guides to the main nav

Internal linking from every page is the cleanest signal to Google
that /guides isn't a stray page. The previous wiring linked it from
the homepage's "play" section and from /games — fine for visitors,
weaker for crawlers. Nav order is home · games · guides · agents ·
leaderboard, with the new section type and active-state highlight
landing correctly on both /guides and /guides/:slug.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
author
syntaxai <[email protected]>
date
2026-05-07 12:07:35 +01:00
parent
52b2a11
commit
85d54493f01d110bddde631b82558953222b656a

2 files changed · +4 −4

modified src/render.ts +2 −2
@@ -3,7 +3,7 @@ import { marked } from "marked";
33 const STYLE_CSS = "./public/style.css";
44 const css = await Bun.file(STYLE_CSS).text();
55
6-export type Section = "home" | "games" | "agents" | "leaderboard";
6+export type Section = "home" | "games" | "guides" | "agents" | "leaderboard";
77
88 export interface PageOptions {
99 title: string;
@@ -25,7 +25,7 @@ const navLink = (href: string, label: string, active: boolean): string => {
2525 return `<a href="${href}"${cls}>${label}</a>`;
2626 };
2727
28-const nav = (active?: Section): string => `<nav class="md-nav">${navLink("/", "tdd.md", active === "home")} <span class="md-nav-sep">·</span> ${navLink("/games", "games", active === "games")} <span class="md-nav-sep">·</span> ${navLink("/agents", "agents", active === "agents")} <span class="md-nav-sep">·</span> ${navLink("/leaderboard", "leaderboard", active === "leaderboard")}</nav>`;
28+const nav = (active?: Section): string => `<nav class="md-nav">${navLink("/", "tdd.md", active === "home")} <span class="md-nav-sep">·</span> ${navLink("/games", "games", active === "games")} <span class="md-nav-sep">·</span> ${navLink("/guides", "guides", active === "guides")} <span class="md-nav-sep">·</span> ${navLink("/agents", "agents", active === "agents")} <span class="md-nav-sep">·</span> ${navLink("/leaderboard", "leaderboard", active === "leaderboard")}</nav>`;
2929
3030 export const renderPage = async (opts: PageOptions): Promise<string> => {
3131 const body = await marked.parse(opts.bodyMarkdown, { gfm: true, breaks: false });
modified src/server.ts +2 −2
@@ -705,7 +705,7 @@ ${rows}
705705 description: "Practical TDD walkthroughs for Claude Code, Cursor, Aider and other AI coding agents — keep your agent honest with red→green→refactor commits, scored by tdd.md.",
706706 bodyMarkdown: body,
707707 ogPath: "https://tdd.md/guides",
708- active: "games",
708+ active: "guides",
709709 });
710710 return htmlResponse(html);
711711 },
@@ -728,7 +728,7 @@ ${rows}
728728 description: entry.description,
729729 bodyMarkdown: md,
730730 ogPath: `https://tdd.md/guides/${slug}`,
731- active: "games",
731+ active: "guides",
732732 });
733733 return htmlResponse(html);
734734 },