I wrote my own static site builder in Go

I know, another one!

I wanted to start learning Go, and I wished for a stupid simple static site builder that I’d understand inside out — so I wouldn’t spend hours digging through docs like I used to with Hugo or Zola. Both are great tools, but they’re already full-grown, feature-rich beasts.

Being a *covid-born software dev, I’ve always cared more about themes first. My usual workflow looked something like this: find a theme I like (usually the most complicated one), tweak it endlessly, never write a single post, delete everything, and start again — either with another theme or a different tool.

Not this time. No, no, no. This time I’m building my own tool — one I fully understand — and I’m finally going to start writing articles.

*A transparent editor and preferably live-wallpaper-demanding coder.

A pure static site builder based on my workflow

Here’s what I had in mind for the first version:

That’s supposed to be the starter pack. I’ll keep adding features gradually, but carefully.

Written in Go

The first language I ever learned was Java. My bootcamp was mostly Java, with a bit of C#. I still like it — and my first CLI app attempt was a little Spring Shell project. Development itself was fine, but building binaries and distributing them was a pain. Plus, Spring Shell is more suitable for long-running, REPL-style apps.

At that time, I was just figuring out which language I wanted to use for building CLI tools. So I moved on and started looking into Rust. I wrote a small CLI tool in Rust that connects to local or remote AI and works nicely with Helix — it takes selected text and fixes typos and grammar. But I’m kind of AI-allergic these days. Feels like LLMs steal some of the joy from software development, but that’s a story for another day.

I enjoyed Rust’s syntax and speed, but man — it’s a tough language. At least for me, at this stage.

So, Go was the next choice. And maaaan, what a pleasant language! It builds insanely fast. I literally rebuild the project every time I notice something to fix while writing this article — and I build the blog alongside it. It doesn’t slow me down at all. Such a nice experience.

This site builder is actually my second project in Go. The first one was a git-based forum CLI app using Bubble Tea. It’s a fun project — it taught me a few git tricks I had no idea existed. Basically, I use git and a bare repo as the “backend” and Bubble TUI as the “frontend,” to give it a forum-like feel. It’s still a work in progress, but I plan to finish it — I like the concept.

So, dear beautiful people of the internet, let me introduce my little static site builder — bib.

Bib the builder

Don’t ask me where the name came from originally. Let’s just say it now stands for “blog I built”, okay?

I’ll share the repo link once I clean it up a bit and finish the main refactor. Right now, Bib’s code is in that “let’s just add this and move it into a separate file later” stage.

And as I’m writing this post, bib is already capable of:

❯ bib
bib - Personal Blog Management Tool

A CLI tool for managing personal blog posts, building static content and deploying to GitHub.

Available Commands:
  init [blog_name]    Create a new blog and configure bib
  post new [title]    Create a new blog post
  post list           List all blog posts
  post list --draft   List only draft posts
  page new [title]    Create a new page
  build               Build all posts and pages to static HTML files
  serve [port]        Start local development server (default port: 8308)

Usage Examples:
  bib init "my-awesome-blog"
  bib init "my-blog" --demo
  bib post new "My First Post"
  bib post new "My Post" --demo
  bib post list
  bib post list --draft
  bib page new "Contact"
  bib build
  bib serve
  bib serve 3000

Use 'bib [command] --help' for more information about a command.

As I mentioned above, more to come, but not that much more 👷‍♂️.

And that is it for now.

Suggested Reading

There are no more posts with bib tag. But hey, read this one. Should be okay.

LLMs suck the fun out of coding

Today I stumbled upon [this](https://www.youtube.com/watch?v=AEybWzeAkho) video. Right at the beginning, it mentions “Don’t rewrite, reinvent....