Publish Your Recipe Collection as a Static Site with `cook build web`
If you keep your recipes as .cook files, you already have something most recipe apps don't: a folder you fully control. The new cook build web command does the obvious next thing — turns that folder into a website you can share.
No server. No database. Just HTML, CSS, and JavaScript you can drop on any static host or open straight from disk.
What it does
cook build web walks your recipe directory and generates a self-contained site that mirrors the browsing experience of cook server. Recipe pages, menus, directory listings, search — all there, all rendered ahead of time.
That writes a complete site to ./_site. Open _site/index.html in a browser and you're done.
Because the output is read-only, a few features from cook server are intentionally left out:
- Shopping list and pantry
- The recipe editor and "New recipe" button
- Recipe scaling (output is always 1×)
- Sync and preferences
What you do get: every recipe page, every menu, search across the whole collection (running entirely in the browser via a generated index), images, and the raw .cook source linked from each recipe page.
Publishing to GitHub Pages
The most useful real example. From your recipes directory:
Enable Pages on the gh-pages branch in the repo settings and your collection is live. Internal links default to page-relative paths, so no base URL configuration is needed — the same _site/ folder works on Pages, on Netlify, or opened directly from disk.
Re-run cook build web whenever you edit recipes. The command is idempotent; commit the diff.
Other hosts
If you need to host under a subpath (like example.com/recipes/), pass --base-url /recipes/. Otherwise, leave it off — relative links handle every other case.
Heads-up: the command name changed
If you were using the very first release of this feature, the command was just cook build. It's now cook build web.
The reason: build is shaping up to be a family of commands. Static site is the first target; printable cookbooks and other artifacts will live alongside it. Nesting under a subcommand now means we won't have to reshape the CLI later.
Update any scripts or aliases:
cook build --help shows the available targets.
When to use which
cook server is still the right tool for daily use on your own machine — editing, shopping list, scaling, sync. It runs locally and gives you the full app.
cook build web is for everything that isn't that: putting your recipes on the internet, sharing a snapshot with someone, archiving a collection to a USB stick, or generating a site that survives without any Cooklang software installed.
Both read the same .cook files. You don't have to choose one over the other — server for cooking, build web for publishing.
Try it
Update CookCLI to the latest release:
Then from any folder with .cook files:
That's it. Full reference is in the docs.
-Alexey