Bengal 0.4.1
A focused correctness patch — valid JSON-LD on every doc page, the data_table template function wired up, working autodoc "View source" links, honored asset and render-isolation config, atomic health auto-fixes, a guaranteed build_complete teardown hook, and re-armed architectural guard tests.
Key theme: Stop shipping wrong output. 0.4.1 is the first patch off 0.4.0 — eight backward-compatible correctness and data-safety fixes surfaced by a repo-wide audit right after the 0.4.0 cut. No new features, no breaking changes; everything here makes already-documented behavior actually work.
What's fixed
Output correctness
- Valid JSON-LD on every doc page. The default theme's article JSON-LD
@typerendered an unquoted token (| tojsonbound only to theelsebranch), emitting invalid structured data that search engines and AI crawlers reject. The conditional is now parenthesized so the value is always quoted (#442). {{ data_table(...) }}works. Thedata_tabletemplate function was implemented and unit-tested but never registered through the production path, so any template calling it raisedUndefinedError. It's now wired intoregister_all()(#434).- Autodoc "View source" links resolve. They previously always fell back to
#; they now build a real GitHub blob URL whengithub_repois configured, expandingowner/reposhorthand and honoringgithub_branch(#441).
Configuration honored
- Asset config respected. Restored the documented
from bengal.assets import AssetManifestimport, and the asset orchestrator now reads the nested[assets]settings (minify,optimize,fingerprint) instead of deprecated flat keys — sominify = falseunder[assets]actually disables minification (#447). - Render-isolation options + section validation.
build.render_isolation*options are now read from config instead of being silently swallowed, and the config validator recognizes seven additional valid sections (output_formats,structured_data,external_refs, and more), eliminating spurious "unknown config section" warnings (#446).
Reliability & data-safety
- Atomic health auto-fixes.
--auto-fixnow writes user content files with write-temp-then-rename instead of overwriting in place, so an interrupt mid-write can't truncate a source file (#440). build_completealways fires. The documented plugin teardown hook now runs exactly once even when a mid-build phase raises — so cleanup callbacks (closing connections, writing summaries) execute on failed builds. The original error still propagates afterward (#437).- Re-armed architectural guards. The core composition-over-inheritance guard tests scanned a module that defines no page class and trivially passed; they now inspect the live
RuntimePageand go red if it re-acquires a mixin base or hoists a rendering import to module scope (#433).
Upgrading
uv pip install --upgrade bengal
# or
pip install --upgrade bengal
A pure patch release — drop-in for any 0.4.0 site. If you set minify = false under [assets]and noticed assets were still minified, or saw "unknown config section" warnings on a valid config, those now behave correctly.