track the demo as a real site in examples/, gated like the docs

The human asked for a demo extensive enough to review by hand, tracked as files,
and kept current the way docs are. Generated filler cannot be reviewed — you cannot
read a Go function and see what a reader sees — so the generator is deleted and
`examples/demo-site/` is an ordinary site: 33 Markdown files, six pictures,
site.yaml, a template override and static files.

My reason for generating it was ADR-0011, and I had that rule wrong: it puts the
*author's site root* outside this repository, not fixtures. conventions.md already
keeps golden files in testdata/, and this is the same category one size up. Keeping
both a generator and files would have been two sources of truth, so one had to go.

Kept true by two gates rather than by good intentions. A table-driven test in
internal/web serves the directory through the real handler with one case per
feature — thirty-five of them, each naming what it proves — and verify.sh runs
`khosra check` over it and fails on anything fatal. Adding a feature now means
adding it to the demo and adding its case, and the build says so if you don't.

Extensive on purpose: eleven dated posts so a section actually paginates, a
four-chapter series so first/last are not the neighbours, a gallery with three
JPEGs and an SVG so both the resampled and the untouched paths show, a Bengali-only
bundle, a titleless status, a draft, a future date, an include, a nested extras
tree, and a typography page that demonstrates what the engine will not do.

Two expectations of mine were wrong and the demo corrected them: the site's own
list template overrides *tag* listings too, so there are no group headings there —
which turns out to be the better demonstration of ADR-0046, since the theme picking
the flat shape is exactly the point. And template literal text is not escaped, so
an apostrophe stays an apostrophe.
This commit is contained in:
2026-07-31 20:08:28 +06:00
parent 4bbc9d44a1
commit 8a2ef082be
55 changed files with 542 additions and 280 deletions
+12
View File
@@ -114,6 +114,18 @@ if [ -d .git ] && command -v git >/dev/null 2>&1; then
pass "raw HTML stays disabled"
fi
# The example site is a demonstration that has to stay true (ADR-0051). `check` over it catches the class of
# rot a test cannot: a content rule that changed while the example kept the old shape. Findings are allowed —
# the example carries one on purpose — but nothing fatal is.
if [ -d examples/demo-site ]; then
if go run ./cmd/khosra check -site examples/demo-site >/tmp/example-check.log 2>&1; then
pass "the example site still checks out"
else
bad "examples/demo-site has a fatal finding — the demo must stay a site the engine accepts"
sed 's/^/ /' /tmp/example-check.log
fi
fi
# Dangling references. Every one of these found a real stale pointer when run by hand.
refs=$(grep -rhoE '`(docs|scripts|ideas|reference|\.claude)/[A-Za-z0-9_./-]+`' \
docs CLAUDE.md HARNESS.md ideas reference .claude scripts 2>/dev/null | tr -d '`' | sort -u)