Pure static site generation
toSSG walks the registered routes at build time and writes one real HTML file per route. /404 becomes 404.html.
What's inside
Every feature on this site is a lesson from learning Hono and Bun. Most exist because the default toolchain got in the way of something first.
Each one is small. Together they are the whole project.
toSSG walks the registered routes at build time and writes one real HTML file per route. /404 becomes 404.html.
No bundler, no hydration, no inline bootstrap script. The strict CSP isn't a compromise; there is nothing to exempt.
hono/css collects styles at render time and emits them inline, so each page ships only what it uses. The 404 page has none of the home page's styles; that's checkable indist/404.html.
bun --hot reloads the server; a ~15-line script polls a hash endpoint and reloads the browser. Both are dev-only.
404.html catches every unmatched path on Pages, and app.notFound returns the same styled page in dev. Both are marked noindex.
Served in dev exactly like production, pre-rendered at build, and generated from oneROUTES array that can't go stale.
public/_headers covers static assets; Hono's secureHeaders covers app responses. The two are kept byte-identical.
17 tests using bun:test and the app's own request(); no supertest, no test doubles, no extra dependencies.