Two pages the site built out of itself

Part 3 of 7 of ./blog.sh v1.5

Until now this engine could show you ten posts at a time and nothing else. /page/128/ is a real address on a large archive, and it tells you nothing about whether you have landed in 2009 or in 2014 — pagination is anchored from the oldest post, so the number moves under you every time something is published. The only complete list of anything lived in the terminal.

1.5 adds two pages that read the archive instead of walking it.

/archive/ — the shape of the whole thing

A row per year, with a strip of twelve months beside it. A month is shaded in one of four steps rather than simply lit or dark, because "has posts / has none" is not the question worth answering: on the reference archive a month holds anywhere from one post to eighty-seven, and drawing those the same would hide the one thing a map is for. /archive/<year>/ is one line per post, by month.

Two levels and no more. A third would be some 280 pages of individual months — a great deal of building for a question nobody asked.

It is an index, not another listing: no excerpts, no pictures, no cards. And it is cheap by construction. Publishing a post rewrites the map and the current year; 2014 has not changed since new year's eve 2014 and never will, so a deploy that compares content has nothing to upload for it, ever again.

The archive map of sean.cz: a row for each year from 2026 down to 2003, each with its post count and a strip of twelve shaded months
Twenty-four years on one page: 6,625 posts, from a year that holds 23 of them to a year that holds 641.

/tag/ — every subject the site has

The engine has always built a page per tag and never anything that showed them all. A site's own list of what it writes about lived in browse, or in the top eight of stats.

The list is sorted by the folded name, and that is not a detail. Ruby sorts strings by bytes, which puts every accented tag after z: on one real archive that is fifty-two of them, and the last six in byte order are školení, školitel, šumava, švihov, želnava, životvkorporátu. A reader looking for one of those between sirky and sport would not find it. stats folds now too — one question should not have two answers.

Each tag is a pill with its count riding inside it as a superscript, so a line that wraps cannot strand a number beside the wrong name. A reader can switch the order to by-count and the choice is remembered. But the page is built alphabetically and the switch is a script on top of it: a reader whose browser never runs that script gets the order the markup already holds, rather than a control that does nothing.

The tag index of sean.cz: tags drawn as pills in wrapped rows under letter headings, each with its post count in superscript
846 tags under 27 letters — and čarodějnice, česká televize and české dráhy under C rather than after z, which is what the folded sort buys.

Nothing to configure

Both pages are made out of the posts. There is no list to maintain, no front matter to add, and nothing that can drift out of step with what the site actually holds.

Every tag that has a page appears and no others. A tag carried only by a draft, a page or an unlisted post is drawn under its post as a flat pill with no link — listing it here would point a reader at a 404, and an index that lies about one address is an index you have to check.

Comments