Skip to content

T-QWFA-site-pages-eta-templates

Status: closed/done · Impact: medium · Complexity: medium

Close the idiom split inside the docs service: the site generators (site.ts, data_model.ts) build pages with inline template literals, while the wiki artifacts honor the declared contract — TS assembles plain data, Eta templates own ALL layout. Every site page moves onto the same split, with byte-identical output as the proof of equivalence.

LocationRole today
plugin/lib/services/docs/generate.tsDeclares the data-to-template split; wiki artifacts honor it via *_template.eta
plugin/lib/services/docs/site.tsSkills/entities/ops pages, rosters, child pages, sidebar module — all inline string interpolation (regen.mjs port lineage)
plugin/lib/services/docs/data_model.tsWhole page as one template literal, narrative blocks inline

One site_*.eta template per page kind beside the wiki templates; the TS keeps only data assembly (rows, cells, flags) and writeIfChanged. A shared raw render helper (no normalizeWhitespace — site bytes must not shift). sdlc docs generate site produces zero git diff after the refactor.

  1. Add a raw site-template render helper (own Eta instance, autoEscape: false, autoTrim: false, no normalization).
  2. Port page kind by page kind — skills, entities, ops, ref index, glossary roster, references roster, child pages, sidebar module, data model — verifying zero diff in site/ after each.
  3. Conditional layout (omitted followup tables, empty-corpus placeholders, optional meta lines) moves into <% if %> blocks; data objects stay plain.
  4. Tested exports (collectEntityTypes, renderDataModelPage) keep their signatures.
LocationKindChange
plugin/lib/services/docs/site.tsmodifyLayout strings out; data assembly + template calls remain
plugin/lib/services/docs/data_model.tsmodifyNarrative blocks move to the template; derivation stays
plugin/lib/services/docs/site_*.etanewOne template per site page kind
  • AC-1: sdlc docs generate site after the refactor produces zero git diff under site/ (byte-identical pages).
  • AC-2: No inline page-layout template literals remain in site.ts / data_model.ts — layout lives in .eta files only.
  • AC-3: Full test battery green; tsc clean; Astro build 124 pages.
  • Changing any page’s content or layout — this is a pure representation refactor.
  • Routing site pages through normalizeWhitespace (would shift bytes; revisit separately if ever wanted).
  • T-BX15 — the child pages and sidebar module it templates landed there.
  • User review of the D-0009 stack: “are we using inline string interpolation for some of the templates?” — the regen.mjs port lineage carried the string-building idiom into site.ts, and P4–P6 followed the file’s local idiom rather than the service’s declared split.

T-BX15


← Back to Tasks