0.2.0
Ten issues, closed together. Most of them were the same bug wearing different clothes: a build that exited 0 and wrote a site that was wrong in a way nothing on the site revealed.
Breaking
The home page is no longer described in site.json. portrait, contact,
elsewhere and home are gone, along with the three structs behind them and
the procedure that turned them back into the markup they started as. A site now
writes html/home.html and gets the whole page, with <!--ostat:recent-->
marking where the recent posts goThe data model had to grow a field for every idea a home page might have, and the generator a branch to draw it. A fourth section meant editing write_home and recompiling; a paragraph or a table had no representation at all. A document is stored as a document now..
html/ also holds header-01.html and header-02.html, the two halves of
every page’s <head>, and not-found-404.html. Each is optional and falls
back to a built-in default, so a bare content directory still builds. This is
the arrangement gingerBill’s generator uses, read at runtime rather than
compiled in, because compiling it in is what would undo multi-site support.
Three content trees that used to build now fail, on purpose:
- A directory inside a section directory. Section membership was an exact
string comparison, so a page under
blog/2024/was built and crawlable and reachable from nowhere on the site. - A section directory with no
_index.md. Every page inside it linked a breadcrumb to a page that was never written. - A root
content/_index.md. It was loaded, written, and then overwritten by the synthesised home page, and the sitemap advertised the front page twice.
An _index.md marked draft removes its section, so that now fails too.
Fixed
- Two pages resolving to one output path both stayed in every listing, the feed and the sitemap, while the later write took the path
- A file in
static/silently replaced the generated page at the same path, including the home page, the feed and the sitemap -o,-base-url,-todayandostat new -stook a following flag as their value, soostat build . -o -draftscreated a directory named-draftsand reported successtruncate_wordsmeasured its limit in bytes and cut on a byte offset, which landed mid-codepoint and put invalid UTF-8 in the meta description of any page whose summary had no ASCII space in it- Feed items kept root-relative URLs in single-quoted attributes,
srcset,poster,citeand CSSurl(), where they resolve against the reader’s host - A bare
&madestrip_tagssearch the rest of the document for a;and swallow everything between it as one entity base_urlandlocalereached six URLs and attributes unescaped, and-base-urlreplaced the value after it was checked
Also
ostat writes a 404.html, which it did not have at all.
The test suite went from 82 to 98. The golden tree is unchanged except for the new 404 page, which is what says the home page migration was faithful rather than merely finished.