Happiness and Misadventures

Migrating This Blog to Hugo

Last week, I wanted to challenge myself with an exercise: migrating this blog from omg.lol’s Weblog to a “classic” Hugo website, whom I became an aficionado.

Why?

…one could ask. Well, probably because I was a little bored and organizing the Medialog was becoming quite a pain: too many lines of code for every image. With Hugo’s shortcodes, it would have been much easier to organize the pagination.

Also, as I wrote previously, I wanted to implement a mechanism to automatically edit the blog images with dithered ones. Simply, with Weblog –for me– it would have been too difficult.

Anyway, Adam has all my respect and I love his projects. In my opinion, omg.lol provides all the tool one could ask to live an “healthy” digital life.

How?

I exported my Weblog data (super easy and organized!) and, with sed and the “replace” tool, fixed the front matter to match the TOML syntax. Since posts is one of Hugo’s default taxonomies, the menu was ready in a few minutes.

Then, I immediately focused on the Medialog section, and I discovered the real Hugo’s potentiality, which I haven’t used properly in my other four projects that use it! It was easy to create a page in the _default section to manage different markdown files, one per entry. Also, the old Weblog’s CSS was 90% perfect as it was.

I managed to add customized Opengraph cards with the titles of the posts using Aaro’s tutorial, and it was super easy. Last, I focused on the dithered image generation, for which I used ImageMagick and a Bash script.

Why, again?

I don’t know. 🫠


🎮 Still on Far Cry 4 in my spare time

🎧 Some classics from R.E.M.

📖 NOS4A2


Reply by email ✉️