Written on September 22, 2025
how this site works (why i built my own ssg in c)
inspiration
For a few months now, inspired by sites like Hundred Rabbits and Brad Woods Digital Garden, I wanted to create my own digital garden. A simple site with content that I can improve over time: useful resources, ideas, and notes. Yesterday (September 21, 2025) I decided it was finally time to build it.
...but it had to be special
I knew I wanted to make it as minimal as possible while keeping a modern design. At first I considered using just vanilla HTML, CSS and a bit of JavaScript. But I quickly realized that if I wanted a header on every page and a global CSS file, I'd need to copy-paste everything to each page. If I wanted to modify the header, I'd have to replace it in every file. I knew I needed some kind of SSG (Static Site Generator).
My experience up until now was mostly with React.js and Next.js web applications. But those frameworks are bloated with lots of dependencies and features I don't really need for my simple site. So, inspired by the Hundred Rabbits philosophy about future-proofing, permacomputing and simple tools that get the job done, I decided to build my own little Static Site Generator in standard C. No dependencies, no complex logic. Just a simple program that solves my specific problem.
but why C?
I'd never written any program in C until now. I have experience with C++, JavaScript, Go, C# and others, but never touched C. So I thought this was the perfect opportunity to learn something new. Of course, this is a 200-300 line program. This could've just as well been a simple bash script that did the same thing, but I wanted to become more familiar with C.
how does it work?
The idea is simple: have some "components" and inject them, alongside the page content, into a new file following a specific structure. Run the build.sh script and commit the changes to GitHub, then the site gets deployed on GitHub Pages and everything works without any other complex tooling.
Here's my `generator.c` code as of September 22, 2025: generator.c