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:
Claude Opus 5
2026-07-31 20:08:28 +06:00
committed by bdeshi
parent 4396303771
commit de1ce73430
55 changed files with 543 additions and 281 deletions
@@ -0,0 +1,6 @@
---
title: Day 01
date: 2026-02-01
tags: [journal]
---
The 01th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 02
date: 2026-02-02
tags: [journal]
---
The 02th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 03
date: 2026-02-03
tags: [journal]
---
The 03th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 04
date: 2026-02-04
tags: [journal]
---
The 04th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 05
date: 2026-02-05
tags: [journal]
---
The 05th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 06
date: 2026-02-06
tags: [journal]
---
The 06th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 07
date: 2026-02-07
tags: [journal]
---
The 07th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 08
date: 2026-02-08
tags: [journal]
---
The 08th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 09
date: 2026-02-09
tags: [journal]
---
The 09th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 10
date: 2026-02-10
tags: [journal]
---
The 10th entry, here so the section listing paginates: eleven posts against a page size of ten.
@@ -0,0 +1,6 @@
---
title: Day 11
date: 2026-02-11
tags: [journal]
---
The 11th entry, here so the section listing paginates: eleven posts against a page size of ten.
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

@@ -0,0 +1,9 @@
---
title: প্রথম আলো
date: 2026-03-01
tags: [monsoon]
---
এই লেখাটি বাংলায়। তারিখ, সংখ্যা, আর পৃষ্ঠার নাম — সব বাংলায় দেখা যাবে, কারণ ইঞ্জিন নিজের কথাগুলো
অনুবাদ করে রাখে।
লেখকের লেখা কখনও অনুবাদ হয় না; কেবল ইঞ্জিনের নিজের শব্দগুলো।
@@ -0,0 +1,13 @@
---
title: First Light
date: 2026-03-01
tags: [monsoon, beginnings]
---
This post exists in two languages, so the footer's language links go somewhere and `hreflang` has something
to point at. Its Bengali twin is `index.bn.md` beside this file.
It also owns a picture, which only a *directory* bundle can do:
{{< figure src="cover.jpg" alt="A grey-green gradient standing in for a photograph" caption="A caption, rendered by the theme's figure fragment" >}}
The picture above is served from this bundle's own directory, and the `srcset` on it names generated widths.
@@ -0,0 +1,8 @@
---
title: Only in English
date: 2026-02-20
tags: [beginnings]
---
There is no Bengali version of this one. Ask for `/bn/posts/only-english/` and the engine serves this instead
of a 404 — the fallback chain is requested, then the default locale, then any variant at all. The canonical
link in the head names the variant you actually got, not the one you asked for.
@@ -0,0 +1,10 @@
---
title: This Was Renamed
date: 2026-02-25
slug: a-better-name
aliases: [posts/renamed-thing]
---
This file is at `content/posts/renamed-thing/`, but `slug:` moves its address to `/posts/a-better-name/`.
The old path still works, because `aliases:` promises it will — it answers a permanent redirect.
The bundle's *key* never moved, which is why the series and cache machinery could not care less.
@@ -0,0 +1,6 @@
---
title: Scheduled for Later
date: 2099-01-01
---
Dated in the future, so it is not published yet. The engine reads the clock per request, which means this
appears by itself the moment its date arrives — nothing to restart, nothing to invalidate.
@@ -0,0 +1,7 @@
---
title: Unfinished
date: 2026-04-10
draft: true
---
A draft. Not served at all: not here, not in a listing, not in a feed or a sitemap — and neither is any file
beside it. `khosra -dev on` is the only thing that reveals it.