Result of rewriting the website


June 6, 2026

So I rewrote the blog from scratch. I used templ, and go to compile static html pages, and tailwind css v4 for the styling. The static html pages are then served with a web server.

This is the result:

So the number of lines of code was reduced by 4x... and the stewart.bot codebase was already quiet minimistic anyways. It would of been very hard to have reduced the typescript any more. The number of dependencies in air, the go cli tool, is surpising, removing it would mean the dependencies look like roughly like going from 1511 dependencies to 66. Even with 118 dependencies though that is roughly 13 times more dependencies, which might mean 14 times less security vulnerabilities, and 14 times less time upgrading dependencies. I might took to replace air with a generic command line runner. It just watches files, and runs cli tools. I could just replace it with a makefile or justfile.

I think this exercise was worth it. I went from having a broken next.js build, and not being able to publish blogs, to having a lot more minimistic styled "writings" website. I learnt a lot about styling blogs, and not just have a generic webpage. I found it interesting comparing my blog website to other dev blog websites with similar domains as me, such as stewart.io - minimistic and nice, and stewart.dev - boring and plain consulting site. I didn't think i realised how many boring generic blog website there are. Here is another two nice blog website:

Both of those actually use blog templates, or 3rd parties.

Calculations

Number of lines of code in new codebase

Number of lines in old codebase

Number of dependencies

new codebase

27 in my go.sum file 109 in air (https://github.com/air-verse/air/blob/master/go.sum) 24 in templ (https://github.com/a-h/templ/blob/main/go.sum) 160 in total, filtering out duplicates means there is 118 dependencies

Or:

go mod graph | wc -l
66

old codebase

pnpm ls --parseable | wc -l
946

Or including all dependencies:

pnpm ls --parseable --depth Infinity | wc -l
2005

Depth two seems reasonable:

pnpm ls --parseable --depth 2 | wc -l
1511

Number of config files

.air.toml go.mod 2

Old jsconfig.json next.config.js next-env.d.ts package.json pnpm-workspace.yaml postcss.config.js prettier.config.js tsconfig.json tailwind.config.js contentlayer.config.js 10

BACK [B]