Since 2018 this blog has been generated on my Lenovo laptop. It was an ideal setup as I’m the only one writing posts, my laptop is portable, if I want to write things I can take it with me. The files are all here, in a directory named ‘blog’, it’s a simple and effective workflow.

However, I’ve moved on to using a new laptop, and since moving to my own place I finally got an internet connection that I control and can use to run a home server. There are some advantages to moving the source files for this blog from my laptop onto their own server.

Before 2018 I was living abroad, moving around a lot, I had a Raspberry Pi at home in Oxford with a USB stick plugged into it. It was fairly useful to have this tiny computer always online and available to run background tasks. I still have that Raspberry Pi board, so before going back from Leicester I left it plugged in and connected to the internet.

I wanted to mount the USB stick permanently, but messed up the fstab configuration and missed the warning that a broken fstab config can

quite easily cause your system not to boot.

Without double-checking, I rebooted the system

sudo reboot now

and reconnected to see if my USB stick mounted on boot.

ssh: connect to host: No route to host

My heart sank. I accidentally bricked my Pi, and it’s not like I can easily pop back up to Leicester to sort it out, at least not while the country is in lockdown.

I still want a remote server, so I got the cheapest VPS offered by Linode. Here’s what you get for $5 per month:

Ordering a new Pi would cost $35, plus a power supply/case/SD card, and for the same amount I can pay for 7 months of VPS use. The VPS isn’t cost-effective in the long run, but for the moment it’s not an excessive expense. Plus, hey, I got paid last month!

I took advantage of the move to upgrade from Jekyll 3.8.5 to Jekyll 4. I’d been reluctant to upgrade because of potentially site-breaking changes to the way links are generated.

In version 3.8, if your site was in a sub-directory (eg. ‘blog’) you set the basurl to be ‘blog’ in the config.yml file, and prefixed all links with {{site.baseurl}}. In version 4, you simply use {% link /directory/blah/blah/blah/teapot.jpg %} and the baseurl is automatically prepended to the link.

I’ve left links to image files and other media alone, but links to posts are now using the post_url tag, without baseurl. Matthieu wrote a helpful python script to automatically convert these links in all the files in my posts directory.

Since running the script and copying over the site, I’ve noticed the last couple of characters in some files have been duplicated. Initially this was flagged by Jekyll as an error with UTF-8 encoding on a single post, but now I realise it affected some other posts too.
It doesn’t affect all posts.
And the number of characters copied changes in every case.
Weird. At least that’s not too difficult to fix manually over time.

The benefit to having Jekyll handle internal links is that it throws an error when a link is broken. I should go on to convert all other links to use the {% link %} tag, but that’s something to deal with another day.

Otherwise, all I’ve done here has no outward-facing effect. The only performance gains are on my end - the whole site now generates in around 6-7 seconds on the server, compared to 80+ seconds on my laptop.

The real advantage of generating the site remotely is that it can be generated at regular intervals with a cronjob. So, even though it’s a static site I can now experiment with static-but-regularly-generated dynamic services like:

Other changes

I’ve rewritten the 404 page so that it just shows the GMod error texture. It’s now much less useful, but more funny :)

gmod texture

The HTML is compressed using jekyll-compress for very slightly faster page loading. The main difference is getting rid of excess whitespace caused by liquid tags.

Finally, I’ve added little navigation emojis to the top of every post, along with other small layout changes.