Skip to content

Migrate 28 templates to use the new partial system - #66

Open
briananders wants to merge 3 commits into
mainfrom
claude/stupefied-kirch-migrate-pages
Open

Migrate 28 templates to use the new partial system#66
briananders wants to merge 3 commits into
mainfrom
claude/stupefied-kirch-migrate-pages

Conversation

@briananders

Copy link
Copy Markdown
Owner

Summary

Builds on top of #65 (the partials foundation). Sweeps through post and top-level templates and replaces the repeated section + content-wrapper + blockquote markup with calls to the partials. Once #65 merges, this PR's diff will reduce to just the migration changes.

This is the aggressive variant — most templates that cleanly fit the partials are migrated.

Templates migrated (28)

Pattern Templates
Section wrappers 28 templates (97+ <section> instances)
Blockquotes with cite + blockLink 6 templates: 2d-automaton, cellular-automaton, moire-patterns, moire-pattern-colors, last-fm, polyrhythm
Toast notifications wordle-solver, wordle-solver-2
Results displays wordle-solver (1), wordle-solver-2 (2)

Top-level: index.html.ejs (contributions section), about.ejs, drums.ejs (intro section), 404.html.ejs.

Posts: 2d-automaton, ant-life-simulator, blue-green, canvas-static, cellular-automaton, coin-flip, color-canvas, design-system, earth-rotating-sprite-animation, last-fm-scrobbles, last-fm, minesweeper, moire-pattern-colors, moire-patterns, music-news, polyrhythm, raining-light-effect, raining-paint, sound-frequency-slider, sticky-stacky, unique-stars, wordle-solver-2, wordle-solver, yahtzee.

Two partial fixes along the way

While migrating I discovered a collision: the page's front-matter title was leaking through the {...locals} spread, so calling partial('section/open', {...locals}) without an explicit title rendered a duplicate page heading inside every section.

  • Rename title -> sectionTitle in section/open.ejs
  • Rename title -> resultsTitle in results.ejs
  • Update design-system.ejs callsites to use the new names

This is the same kind of collision that previously forced inputName / helpText in the form partials.

Templates left unmigrated (by design)

These don't fit the partials cleanly:

  • Article-based "tip" postsmy-favorite-aliases, my-favorite-git-aliases, my-git-config, how-to-get-rid-of-untracked-files-from-your-git-branch, how-to-git-merge-without-being-prompted-for-a-message, how-to-match-the-height-of-sibling-elements, quality-podcasts. These use <article class="content"> as the page wrapper.
  • Templates with <header> wrappers around headingsin-view-text-animation, interview-question, vertically-center-siblings, reverse-hover-state, browser-and-device-diagnostics. Migrating would lose the semantic header element.
  • Custom wrappers / no sectionwordscapes-solver (uses <div class="container section">), lissajous-curve, line-circle-rotator, paint, imdb-ratings (uses .movies-container), circle-multiplier, making-animations-with-squares, using-canvas-to-make-patterns-with-circles, circle-wave-illusion.

Verification

  • npm test — passes (build + golden tests)
  • npm run build:golden — clean, no errors
  • Golden output for migrated pages was diffed against pre-migration HEAD. Differences fall into three buckets:
    • 0 lines — byte-identical: 16 templates (minesweeper, canvas-static, coin-flip, color-canvas, raining-light-effect, blue-green, sound-frequency-slider, raining-paint, ant-life-simulator, unique-stars, sticky-stacky, music-news, about, drums, index, 404)
    • Whitespace + noWidows typography fixes — 7 templates, 4-16 lines each (yahtzee, polyrhythm, last-fm, moire-patterns, moire-pattern-colors, 2d-automaton, cellular-automaton). noWidows() adds &nbsp; before the last word in headings to prevent widows.
    • Accessibility + semantic improvements — 4 templates (wordle-solver, wordle-solver-2, last-fm-scrobbles, earth-rotating-sprite-animation): toast got role="status", aria-live="polite", and inner semantic spans; results count got aria-live="polite"; some code blocks have 2-space-less indentation inside <pre>.

Not in this PR

  • No golden/ updates committed. Visual-diff baselines for the affected pages will need refreshing in a follow-up "new goldens" commit (matches the existing repo convention seen in commit ad48ae1).
  • No SCSS or JS changes.

Test plan

  • npm run build:golden succeeds.
  • npm test passes.
  • Migrated pages diff to semantically equivalent HTML (see breakdown above).
  • (Reviewer) npm start and spot-check a handful of migrated pages in the browser — especially polyrhythm, wordle-solver, last-fm, drums, and the homepage.
  • (Reviewer) Optional: regenerate golden/ and commit as a follow-up.

🤖 Generated with Claude Code

briananders and others added 3 commits May 15, 2026 02:09
Introduce 12 partials in src/partials/ that consolidate recurring markup
patterns found across post templates: section wrappers, blockquotes,
canvas demos, form inputs (field/select/range/checkbox/radio-group),
results displays, toast notifications, and page intros. Demonstrate
each one live on the design-system page.

Form partials use `inputName` and `helpText` instead of `name` and
`description` to avoid silent collisions with siteData and front-matter
keys that come along through the `...locals` spread.

No existing templates are migrated; partials are additive and opt-in.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sweep through post and top-level templates, replacing the repeated
section + content-wrapper + blockquote markup with calls to the
partials introduced on the previous branch.

Migrated:
- Section wrappers: 28 templates (97+ <section> instances) — including
  posts/{coin-flip,minesweeper,canvas-static,yahtzee,color-canvas,
  raining-light-effect,raining-paint,blue-green,sound-frequency-slider,
  ant-life-simulator,unique-stars,sticky-stacky,earth-rotating-sprite-animation,
  polyrhythm,2d-automaton,cellular-automaton,music-news,last-fm-scrobbles,
  last-fm,moire-patterns,moire-pattern-colors,wordle-solver,wordle-solver-2},
  plus top-level index, about, drums, and 404.
- Blockquotes with cite/blockLink: 6 templates (2d-automaton, cellular-automaton,
  moire-patterns, moire-pattern-colors, last-fm, polyrhythm).
- Toast notifications: wordle-solver and wordle-solver-2.
- Results displays: wordle-solver (1) and wordle-solver-2 (2).

Two partial fixes along the way:
- Rename `title` -> `sectionTitle` in section/open and `resultsTitle`
  in results, because the page front matter's `title` was leaking
  through the `...locals` spread and rendering a duplicate heading.
- Update design-system.ejs callsites to match.

Templates left unmigrated by design: article-based "tip" posts
(my-favorite-aliases, how-to-*, etc.), templates with <header><h2>
wrappers (interview-question, in-view-text-animation, vertically-center-
siblings, browser-and-device-diagnostics, etc.), and posts with custom
wrapper classes or section structures that don't fit the partials
cleanly (wordscapes-solver, lissajous-curve, imdb-ratings, etc.).

Verified: build:golden completes cleanly, npm test passes, and all
migrated pages produce semantically equivalent output (only changes are
typography improvements from noWidows() on headings, accessibility
additions like aria-live and toast semantic spans, and minor whitespace
that html-minifier normalizes).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant