By Jody —

0.55.0: Cloudflare Deploys, a Live Navigation Preview and New Render Hooks

Version 0.55.0 is out. This release focuses on where a blog can run and how it is edited: a blog can now be deployed as a Cloudflare Worker, the navigation editor previews the sidebar as you type, and themes get three new render hooks.

Deploy to Cloudflare

The new @blognami/cloudflare package builds a blog into a Cloudflare Worker. The whole engine runs inside one SQLite-backed Durable Object, so there is no server or separate database to look after.

npm install @blognami/cloudflare
npm install --save-dev wrangler
npx blognami bundle-cloudflare-worker
npx wrangler deploy

Import @blognami/cloudflare in lib/index.js to add the command. The build writes the Worker script, its static assets and, when the project has none, a wrangler.toml with every binding in place:

  • Database: the Durable Object's own storage. The first request migrates and seeds it.
  • Uploads: an R2 bucket named after the project.
  • Mail: Cloudflare's Email Sending, sent from mail.defaults.from.
  • Jobs: the Durable Object's alarm runs scheduled jobs, and queued jobs run straight after the response.

A Node process is unchanged by the package: its database, uploads and mail stay as they are.

A live sidebar preview for navigation

Editing the site navigation now shows the result as a sidebar beside the editor, updating as you type, instead of plain rendered markdown.

When the navigation is blank, the preview explains the format and offers two examples to start from:

  • Simple: a few links.
  • Grouped: links under ## Heading lines, each becoming a collapsible sidebar group.

An empty state in the markdown editor

A blank markdown editor used to show a blank preview. It now says what the editor is and points to /help, which lists the available syntax.

A URL whose hash names an overlay link now opens that overlay when the page loads. A same-page link to that hash opens it too. This makes it possible to link straight to something like a sign-up form from a post or an email.

Three new render hooks

Themes and packages can add markup in three more places without replacing a view:

  • renderPoweredBy in _footer, after the powered-by link.
  • renderFooter in _subscription_cta, at the end of the call to action.
  • renderAfterBody in _pageables/_post, after a post's subscription call to action.
// lib/views/_pageables/_post.js
export default {
    meta(){
        this.addHook('renderAfterBody', function(){
            return this.renderHtml`<p>Thanks for reading.</p>`;
        });
    }
};

Prebuilt assets and a lighter core

Asset bundling has moved out of the core package into @blognami/bundler, taking esbuild and postcss with it. A production install no longer needs the build tooling.

  • In development and test, assets are built on the fly, as before.
  • Everywhere else, the server serves prebuilt files from build/static-assets, written by the new bundle-static-assets command.
NODE_ENV=production npx blognami bundle-static-assets

An agent guide in new projects

generate-project now writes a CLAUDE.md that imports an agent guide from @blognami/docs, so Claude Code knows how a project is laid out and where each docs page lives. The docs also gain concepts pages for project structure, services, views, and models and migrations.

List example in the markdown help

The list example in /help showed * item. It now shows - item, matching the syntax used everywhere else.

Upgrading

Bump your packages to 0.55.0, or start a new project with npx blognami@latest. There are no migrations, but existing projects need one change: install the bundler.

npm install --save-dev @blognami/bundler

Without it, asset URLs fail with Static assets are not built. In production, run bundle-static-assets as part of your build, before pruning development dependencies.

To check the release, start the server, open the site navigation editor and confirm the sidebar preview appears. If you want to try Cloudflare, npx wrangler dev runs the whole blog locally without an account.