add khosra demo, and give the site a front page

The demo writes a whole site root that exercises every feature: two languages with
a fallback, a series with ordered chapters, a gallery, a figure, an include,
extras, tags across sections, a slug with an alias, an undated page, a draft, a
template override, static files and site.yaml. It generates its filler rather than
copying stored files, because nothing in this repository is content (ADR-0011) — and
that makes it a test of the engine rather than a fixture: anything khosra can do
that the demo cannot express is a gap.

Two things found by generating and then serving it, which is the whole point:

`khosra check` reported the demo's own series as mixing ordered and unordered
members. It was right — the chapter bodies *described* `order: 10` while the
frontmatter never carried it. The checker caught its own author.

And `/` was a **404**. ADR-0008 leaves the root engine-owned, which is right, but
"engine-owned" was never given an answer, so a visitor to the site's own address got
nothing. The root now lists every bundle, newest first, paginated like any other
listing, and 404s only when nothing is published. A hand-written home page stays a
separate decision, recorded as such.

Verified end to end: 23 files written, 12 bundles, 12 derivatives, `check` clean,
and every URL the demo promises answers — including the alias redirecting, the draft
hidden, and the front page rendering through the site's *own* template override.
This commit is contained in:
Claude Opus 5
2026-07-31 19:54:23 +06:00
committed by bdeshi
parent 96313e4eda
commit 4396303771
13 changed files with 360 additions and 14 deletions
+1
View File
@@ -24,6 +24,7 @@ var chrome = map[string]map[string]string{
"position": {"en": "%s of %s", "bn": "%s / %s"},
"extras": {"en": "Extras", "bn": "অতিরিক্ত"},
"back-to-page": {"en": "Back to the page", "bn": "পৃষ্ঠায় ফিরুন"},
"everything": {"en": "Everything", "bn": "সবকিছু"},
"first": {"en": "First", "bn": "প্রথম"},
"last": {"en": "Last", "bn": "শেষ"},
}
+8 -1
View File
@@ -346,7 +346,14 @@ func (r *Renderer) Listing(section, lang string, all []content.Bundle, page int)
if err := r.fresh(); err != nil {
return nil, err
}
l, window := r.paginate(section, lang, content.PageURL(section, lang, page), all, page,
// The root has no section to name itself after, so it borrows the site's title, or says what it is.
title := section
if title == "" {
if title = r.settings.Title; title == "" {
title = text(lang, "everything")
}
}
l, window := r.paginate(title, lang, content.PageURL(section, lang, page), all, page,
func(p int) string { return content.PageURL(section, lang, p) })
for _, b := range window {
l.Items = append(l.Items, r.item(b, lang))