Ondrovo.com

Switching to Hugo

I started working on this site/blog basically as a kid, and it kept going, with ons and offs, for almost two decades now. Here is a brief history of the various incarnations.

History of ondrovo.com rewrites

The very first version used a frameset, because that was cool at the time. I believe this is why it doesn’t work in Wayback Machine, despite being archived. That version wasn’t pretty and had very little useful on it. It was optimized for Internet Explorer 6. I used Microsoft Frontpage and later Macromedia Dreamweaver to make these early webs. Rounded buttons were still made with precisely positioned GIF images (PNG did not support transparency yet) and Flash was the hot new thing. One of the following versions actually used a Flash applet as the main navigation. It was certainly a cool time to make a web. None of that survived and you couldn’t even run it anymore, Flash being long dead and buried.

I learned PHP, and the next version was basically a primitive CMS I made for myself and the one website. Over the years I made at least one more CMS from scratch for the same purpose. It had an online editor, a markdown compiler, all that fancy stuff. The admin section had three passwords to be super duper secure.

These early versions had a live visit counters, which was all the rage in the late 00’s. Crawlers weren’t so big a thing yet (or so everyone thought), so a growing number gave your site a sense of importance and accomplishment. There was a service which let you configure the look & feel and then gave you a link to use as an image src attribute, the image counted visits and automatically refreshed. Another widget from them was polls, a whole comments section similar to Disqus, etc. In many ways, webs of that era were much more interactive and playful than what we have now because of ubiquitous spambots. CORS wasn’t invented yet (oh how I hate it), so all of this was much easier to do. I forgot what that service was called… Blue-something. Later, in the PHP versions, I had my own visit counters. These sites had a relational database with a super overe-ngineered MySQL schema. I used PHPMyAdmin to create and debug it (that’s still a thing, btw). I was never a fan of Adminer.

Talking of spam, I had my own comments section implemented, then replaced it with Disqus, and eventually just hosed it altogether, replacing it with my e-mail address in the footer. Believe it or not, people sometimes write me e-mails about the stuff here. People are generally nicer in an e-mail, too - it feels more personal. I didn’t have many messages, but it’s usually a pleasant exchange.

I don’t remember why I got rid of the PHP CMS, but I’m glad I did, since then I started playing with static site generators. The first version used PHP scripts, it was run locally and the result copied to the server over FTP. I think I used this for 3 years or so. Then, I learned Rust, and rewrote it in Rust. It was faster, can’t say it worked better, but Rust is cool and it was a fun exercise. One of the static generators even had tags and a tag search feature made in Javascript. Then it broke.

The static sites used a custom flavour of Markdown, for the better or for worse. This let me do some cool stuff, like have a special syntax for thumbnails and galleries, or use the good bits from LaTeX in markdown - namely, ~ for  , and \, for a small space.

I independently invented almost the same front-matter convention used in Hugo; my markdown files looked like this:

name: Spinbot
alias: spinbot
description: "What bot? All I see is blur!"
created: 2009-06-13
canonical: 20090613-spinbot
tags: electronics,diy,beambots,solar

---

$ This bot was meant to fly. It spins, at least.

...

Enter Hugo

This year (2022), after a hiatus through Covid (2020-2021) and moving to a new apartment, I decided it’s a good time to revive the blog. How long it will stay active, I can’t say. I would like to build a habit of writing articles that stay online. I’ve been using various forms of microblogging for over ten years now, so writing itself is not the problem. Maybe microblogging is actually detrimental to more long-form writing, now thinking about it. I share everything immediately, in small snippets and photos, and then there’s no need to write here.

Anyway, I ditched my rust contraption and re-created the site in Hugo, which I planned to explore for some time. I don’t like Go, and I don’t particularly love the way Hugo templates work (that is to say, I hate the syntax and about everything about it), but that only needed doing once, now I can create new articles with ease. hugo new with archetypes works great. I had to go through my articles and convert the frontmatter, which wasn’t that bad, and convert the customized markdown to more vanilla version with Hugo shortcodes, which sucked. First I had to discover how to define custom shortcodes.

Caution and info boxes, for example, are made like this:

{{% caution %}}
Beware the werewolf!
{{% /caution %}}
{{% info %}}
Feeding is strictly prohibited.
{{% /info %}}

An image gallery would use a syntax like so:

{{< gallery >}}
  {{< figure src="support.jpg" title="Cucamelon support structure" >}}
  {{< figure src="hanging.jpg" title="Vine with fruits hanging on the string" >}}
{{< /gallery >}}

What I don’t like, beside the ugly syntax, is that this will vendor-lock me to use Hugo. Any switch will mandate another rewrite of the markdown files. Oh well. The deployment itself is just a matter of running a small script that builds the site and rsyncs it to my server.

So here we are now, all shiny and new. I might rewrite it again in a couple years, maybe. It’s certainly not going anywhere. The theme is based on “Sakura”, which I modified to change colors, unbreak some things and get a nicer dark mode. Actually, I used a Sakura Hugo theme someone made, but then I gutted it and took just the CSS file from it. It seems quite a bit different from real Sakura.

Also, check out the light/dark theme in the top right corner, I grabbed it from github and hacked a bit to not load any external resources. Pretty cool, eh?