I’ve finally created this blog
I’m honestly not sure why it took me so long.
I’ve always wanted a place to capture half-baked ideas, but I kept over-engineering the how. (I didn't seem to found a tiny simple self-hosted solution)
Recently my main machine suddenly stopped working and is now being repaired. In the meantime, my only working computer is a 2011 MacBook Air:
- 1.6 GHz Intel Core i5
- 2 GB of 1333 MHz DDR3 RAM
- 64 GB SSD (with a S.M.A.R.T. error)
- Runs macOS High Sierra… and just one Firefox tab at a time!
Engineers always tend to get creative under certain constraints, those specs forced me to build something tiny. so instead of a Svelte 5 dev-container/Docker/ESBuild stack, I tried something different.
My first main idea was to use raw HTML, CSS and JS. I would use Caddy to serve files and then frontend would convert the markdown into HTML. It worked, but SSR wasn't a thing. I then started messing around with a very tiny C++ server, that would convert markdown into HTML on the fly. I was again overcomplicating things.
Caddy + templates
While googling “Caddy convert Markdown to HTML” I found a great TIL by @Jake Lazaroff showing how Caddy’s templates
middleware can preprocess Markdown via Go’s text/template
.
Then I've found a git repo of an blog example using this technique, from D. Bohdan
I forked his repo and used LLMs to made any changes I needed. I've added a theme toggle, as well as my own CSS styling.
The whole workflow now is to just write in markdown, copy it over to /posts
directory, and modify the index.md
file to add it into the index, and that's it!
It also has an docker-compose.yaml
so you can spin it up easily using docker/podman.
The source code is here and I want to thanks both Jake Lazaroff and D. Bohdan for their resources.
The best part of this is that I've found a new way to use this computer. It's pretty slow but it can of course run vim and it's battery surprisingly lasts for a good amount of time. Right now I am on the beach writing this, so I can admire the view when this computer freezes.
I should've brought a coat.