v0.4.14 is an infrastructure release. It leaves build performance untouched and instead turns three common site-organization needs — structured data, non-post content sections, and multilingual content — into first-class features of the core. This very site relies on the i18n groundwork laid here.
What this release solves
Once a static site grows past a blog, three problems keep coming back: reusing a team roster or nav config means hard-coding it into templates; sections like "projects" or "work" that don't belong in the post stream get shoehorned into tags; and shipping two languages usually means forking a second build pipeline. v0.4.14 addresses all three natively.
What changed
Added
- Global data files (
data/) —.json,.yaml,.yml,.jsand.mjsfiles underdata/(configurable viadataDir) are exposed to every template and plugin assite.data. Nested directories become nested objects, sodata/team/members.ymlis reachable assite.data.team.members. Editing a data file invalidates all page caches, and values are JSON-cloned so the worker payload stays safe. - Custom collections —
collections: { projects: { dir, url, layout, perPage, title, posts } }turns a content subdirectory into an independent section with its own list page at/projects/, real static pagination at/projects/page/2/…, andsite.collections.<name>available in templates. Items stay out of the default post stream, RSS and prev/next unless you opt in withposts: true. Both themes ship acollection.htmllayout. - Multi-language (i18n) — declare
site.languagesand per-pagelangfront-matter drives<html lang>. Pages sharing atranslationKeybecome each other's translations viapage.translations, andxfm-plugin-seoinjectshreflangalternates,x-defaultandog:locale:alternate. A single-language site outputs none of this. Themes include alang-switcher.htmlpartial, and nav items accept atranslationsmap for localized labels and URLs. - Auto excerpt fallback (
page.desc) — pages without adescriptionget anexcerpttruncated from the rendered body. Templates can usepage.desc(description || excerpt) in list cards and meta tags; both themes renderpost.descin post lists.
Fixed
- Stale-output cleanup raced on directories.
pruneStalesorted directories deepest-first but removed them withPromise.all, so a parentrmdircould run before its children were gone and fail withENOTEMPTY— silently swallowed, leaving empty directories behind, such as an old/tags/x/page/shell surviving afterpagination.taxonomywas turned off. Directories are now removed sequentially, deepest first.
Should you upgrade
There are no breaking changes — everything here is additive, plus one cleanup fix. Upgrade freely: dataDir, collections and site.languages are all optional and do nothing until configured. If you're starting out, the content guide and the configuration guide cover data files and collections in depth. The translationKey convention described here is exactly how the Chinese and English articles on this site are paired.
Comments