একটি খসড়া ডেমো

ছাদের এক বৃষ্টিমাপকের হিসাব

মেনু

Colophon

সূচিপত্র

Built by khosra, one Go binary, and drawn by its reference theme, khata. The theme’s stylesheet is one file every page links at an address carrying its version, so a reader’s browser fetches it once and keeps it until it changes (a theme may inline it instead, and pay for it on every page); its few scripts only add to a page that already reads without them.

An icon is a name the engine hands to the theme; khata answers with Lucide’s drawing of it, read from the theme’s own files, while a theme of your own might answer with a character. A name it does not know, like :icon[nosuchicon], keeps its text.

Serve this demo

./serve.sh in the demo’s directory, with khata beside it — this site, on localhost:8081.

Serve your own

khosra -site /path/to/site -theme /path/to/theme. Grouped panels open one at a time, and nothing here runs a script.

A block may take its content from a file in the site, so a page can quote part of a program without the copy drifting from it — keeping the line numbers it really has. This is the script that serves this demo:

serve.sh — how this demo is served
16od -An -tx1 -N32 /dev/urandom | tr -d ' \n' > "$state/preview.key"
17pass=$(od -An -tx1 -N16 /dev/urandom | tr -d ' \n')
18printf -- '- token: %s\n  scope: owner\n' "$pass" > "$state/tokens.yaml"
19chmod 600 "$state/tokens.yaml"
20
21echo "sign in as the owner at $base/_khosra/signin with $pass"
22echo "the draft's preview link: $(khosra preview -site . -preview-secret-file "$state/preview.key" -base "$base" posts/unfinished)"
23khosra -site . -theme "$theme" -state "$state" -port "$port" -base "$base" -preview-secret-file "$state/preview.key"

A task list

A task list is checked off in the source and rendered as a disabled checkbox — nothing here is clickable, and nothing is stored (ADR-0078):

  • Highlight code on the server, so no script parses anything in your browser
  • Serve every panel above as plain <details>
  • Find a tipping-bucket gauge that is not a kit

Assets arrive only when asked for

::tally is a site-defined shortcode whose template declares a stylesheet. Calling it twice pulls that stylesheet in once, and a page that never calls it carries no stylesheet for it at all (ADR-0079):

Days the gauge overflowed in June: 7

Days it was read late: more than we admit

Everything about the monsoon

That is ::latest{tag=monsoon limit=4 title="…"}. tag narrows the query, and title replaces the heading the engine would have written — the engine ships one in each language it knows, and an author who wants their own says so.

Every edit, still reachable

A site in git keeps its old versions: an old commit is not gone, it is one query away. First Light opens its history: its list of revisions answers as JSON, newest first, and any commit in it, asked for with ?at= and the commit’s hash, renders through the theme exactly as the page stood then.

It is off until a publication asks for it. render.revisions: true in that post’s own frontmatter is what opens its history; without it the address answers 404, as it does for every other post here. The key cascades like the rest of render:, so a section opens it for everything under it and a site for everything — a choice, because what a history answers includes the author’s own commit messages, and those are not published writing.

And it begins where publication does. Commits from before published: — the drafting, the versions the author decided against — are not in the list. What is browsable is the published thing changing.

It needs nothing else: the requirement is a real git repository at -site, which a clone of this demo already is. This site links no “history” from its pages, on purpose — how much of a writer’s process to show is the author’s decision, not the theme’s.

khosra · khata f417e573 · content 7c489ae1 · 228 publications, 4256671 bytes · built in 1.469531857s