Skip to content

0.2.0

Choose a tag to compare

@vetr0s vetr0s released this 01 Aug 07:16
· 9 commits to main since this release

The home page becomes a document, and seven silent failures stop being silent.

Ten issues, closed together. Most 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 go.

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.

Three content trees that used to build now fail, on purpose:

  • A directory inside a section directory (#3). 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 (#5). Every page inside it linked a breadcrumb to a page that was never written.
  • A root content/_index.md (#1). It was loaded, written, 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.

Migrating

Move the four site.json keys into html/home.html as ordinary markup, and put <!--ostat:recent--> where the post list belongs. A site with no html/ still builds, on a placeholder that says so.

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 (#2)
  • A file in static/ silently replaced the generated page at the same path, including the home page, the feed and the sitemap (#4)
  • -o, -base-url, -today and ostat new -s took a following flag as their value, so ostat build . -o -drafts created a directory named -drafts and reported success (#7)
  • truncate_words measured its limit in bytes and cut on a byte offset, putting invalid UTF-8 in the meta description of any page whose summary had no ASCII space in it (#6)
  • Feed items kept root-relative URLs in single-quoted attributes, srcset, poster, cite and CSS url(), where they resolve against the reader's host (#9)
  • A bare & made strip_tags search the rest of the document for a ; and swallow everything between as one entity (#9)
  • base_url and locale reached six URLs and attributes unescaped, and -base-url replaced the value after it was checked (#8)

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.