As anyone who has stumbled upon this blog probably knows, Hugo has been the static website generator used for this blog until now. I started using it like probably most people: Follow the quick-start, find some fancy-looking premade theme and be happy for a while. I didn't care much for how the theme or even Hugo's (btw. very powerful) templating engine works, the workflow was as simple as copying one of the other markdown posts to a new filename, delete the actual content and edit the metadata fields that make the generator happy.
Why tho?
But then the silent desire for some specific feature starts to creep in. That one post, that should be formatted differently, this thing you would like to have a short-code for, but the theme doesn't provide one.
I don't want to limit myself to any specific topic on this blog. Categories
might come and go, and why should they not? The default "post listing" template
for the template I was using shows all recent posts. This makes sense, if they
are related or at least on the same topic, but I wanted to show <h2>
subheadings for the categories, each with the recent posts of that category
under them.
At this point I forked the theme and implemented it myself glancing over Hugo's docs and copy-pasting snippets from Stack Overflow until it works. Honestly, yes it probably was a very hacky solution and the code could have been much simpler. But I didn't really care. Just work. Just show the posts the way I want to, I'm here to write them and not to implement Hugo themes.
Well, I have changed my mind. I want my own custom theme. For some twisted self-congrulatory reason I dislike coming across other peoples blogs and notice they look identical to mine, just because we all followed that exact same google search when it up and decided on the same theme and build system. After all, it's called a personal website.
Write a new Hugo theme then?
Sure, I could do that. But I want a fresh start and I suspect writing a Hugo theme will result in trying to imitate the existing theme by copy-parting bits until it looks like a worse version of the one it had. Also, I recently discovered zola and I want to try it.
About Zola
Zola is a static site generator written in rust. Similar to Hugo, Jekyll and all the others. It allows you to write in markdown and then renders HTML from it, so it can be served on any web server. Simple, secure and powerful.
I won't go into a rant about the modern web here, lets just say the dependencies of a static site are minimal. How minimal? Only HTML. I plan on keeping this corner of the web JavaScript-free.
Features
Zola comes with a few features I'm specifically interested in apart from being a single binary without dependencies
- Sass compilation
- No JavaScript needed
- Syntax highlighting for code blocks
- Table of contents
- Short-codes and internal links
I'll be using my system wide color scheme for the theme. Sass will make this easy, as it allows defining variables that can be used in multiple places. The result will be pure CSS + HTML (and static assets like images).
Zola vs. Hugo?
Of course, I'm not the first one going this path. There have been multiple discussions and comparisons between Zola and other generators on reddit and hackernews. Here is a nice article, heck even the Zola GitHub page has a comparison charts with Hugo and other alternatives.
At the end of the day, you probably can do then same stuff with any of them. But I want to take it for a spin and Hugo is getting kinda old.
Here it is!
This right here is the first post of my new blog! If you can read it, your eyes don't bleed and you have somehow managed to decipher my words it means I made it.
I wanted to go into a lot of other stuff like nix packaging and the development and design decisions behind the theme, but I'll leave it for another post.