Luis’ Corner

Week 7: Migrating to Hugo and playing guitar

Migrating this blog from Bear Blog to Hugo

Why?

I sticked with Bear from the start as I wasn’t planning on doing anything “fancy” with the blog. Now that I’ve thought of adding images for a while, I think it’s time to use a static website generator, such as Hugo, to serve my own content using e.g. GitHub Pages.

Bear costs US$3 per month (after adjusting for Purchasing Power Parity), but it was still not worth it for me, a programmer anyway.

Bear costs US$3 per month (after adjusting for Purchasing Power Parity), but it was still not worth it for me, a programmer anyway.

Existing script

I found a 2024 blog post that provided the following script for doing the transition:

 1import csv
 2import os
 3
 4with open('post_exports.csv') as csv_file:
 5    csv_reader = csv.reader(csv_file, delimiter=',')
 6    os.makedirs("./pages", exist_ok = True)
 7    os.makedirs("./posts", exist_ok = True)
 8    for row in csv_reader:
 9        dir = ""
10        if row[11] == "True":
11            dir = "pages/"
12        else:
13            dir = "posts/"
14        with open(dir + row[4]+'.md', 'w') as post:
15            publish = row[9]
16            if publish == 'False':
17                draft = "true"
18            else:
19                draft = "false"
20            post.write("+++\n")
21            post.write("slug = '" + row[4] + "'\n")
22            post.write("title = '" + row[3] + "'\n")
23            post.write("date = " + row[6] + "\n")
24            post.write("draft = " + draft + "\n")
25            post.write("tags = " + row[8] + "\n")
26            post.write("+++\n")
27            post.write(row[12])

Doing it manually sigh

But I didn’t like the output. Some of the resulting files were missing metadata, which would take longer to compile manually.

I felt like writing my own script, but I have so few posts at the time that the investment wasn’t worth it. So, for the time being, I’m doing the transition manually. Which also lets me experiment with Hugo’s features and configuration that I would otherwise miss.

Guitar class so far

Short update on my guitar classes:


  1. From the 1911 Encyclopaedia Britannica:

    BUCARAMANGA, a city of Colombia, capital of the department of Santandér, about 185 m. N.N.E. of Bogotá. Pop. (estimate, 1902) 25,000. It is situated on the Lebrija river, 3248 ft. above sea-level, in a mountainous country rich in gold, silver and iron mines, and having superior coffee-producing lands in the valleys and on the lower slopes. The city is laid out with wide, straight streets, is well built, and has many public buildings of a substantial character.

     ↩︎

<< Previous Post

|

Next Post >>

#lang-en #weekly-report