Lessmarcos.comAsteroid Blues

Belbo — static site generator

By Marcos. Tuesday, 01 September 2020

Another static site generator. Sorry for that.

I was using Jekyll and GitHub Pages to generate my (old) blog. Somehow my Ruby version got broken (some gems could not be found and Jekyll could not get started) and, oh boy, it’s been ages since the last time I touched Ruby code or played with Bundler. I didn’t feel like I wanted to fix it, so I decided to go for something new.

1. Static site generators in Go

Well, these days I mainly write Go code (not much, but still) so yeah why not, let’s try to find a static site generator written in Go. To my surprise there are not so many, at least not many popular ones. So I took a look at Hugo. I have to say that the framework is nice and all, but it’s not what I was looking for. The main downside is that it has tons of features.

2. Error number one

For many people tons of features is a plus, but I was looking for something simpler. Sure, I don’t have to use all of Hugo’s features but the API surface area of Hugo is not small in my opinion. So I said, I pass. Let’s try another one. And I tried Zas. I thought I had found THE static site generator I was looking for. It’s very zen and minimalistic and simple but somehow it still didn’t fit my simple (but not simpler) requirements and I really didn’t like that Zas used <embed> to compose layouts. Call me crazy.

I probably overlooked so many projects because at this point I was wondering: how hard can it be to come up with my own static site generator in Go?

3. Error number two

How was that?

It’s harder to read code than to write it

Joel Spolsky

And so I decided to write my own static site generator. The idea was simple:

  • markdown as input, HTML as output
  • everything in the root and posts directory should be taken into account
  • rely on Golang’s template features for layout composition

How hard this could be? Honest answer is I don’t know yet. I did build my own static site generator (belbo) and so far so good (I mean, this website was built using belbo), but I may find that it lacks some features I will need in the future that I don’t need right now.

For example, as of now belbo does not support watch features nor SASS nor themes. It’s not that I do need these features, but still. Also I have already found a couple of bugs! Not very critical but they are already there, lurking.

How easy or hard is going to be to maintain belbo? I think it shouldn’t be that hard, but I let you know in a few months.

4. But hey, this is new

One more thing though. If there is anything that may call your attention about belbo is that it enables what I call Parallel Blogs. It’s not that I’m super proud of this but I’m certainly having fun these days with this little feature available right now (in the entire ecosystem of static site generators) only in belbo. How lame is that!