One of the things I want to get done, now I’ve got time to work on my own projects again, is to bring a lot of my various ‘web presences’ back under my control again –and also to update and [in some cases] add content to the sites, many of which have been sadly neglected of late.
One of the first ‘guinea pigs’ for the challenge was to get this blog out of Tumblr which, although it had its useful aspects [ie. Student PDPs, collation of] while I was teaching, regularly drove me mad with its hideous user interface and general ‘tackyness’. I’m also getting increasingly wary of having my ‘stuff’ depend on other companies. I want to “take the power back, mo’ fo’!”.
I also decided that I wanted to take a look at building this blog using a Static Site Generator, the web design quivalent of ‘fixie’ bike riding. In a tangential move, I’ve also been meaning to do a bit of dabbling with learning Golang. So I thought I might combine the two crazy notions by looking for an SSG written in Golang. There aren’t actually that many Golang-powered SSGs about, but I did find a couple. The one which I liked the look of most was Hugo, so that’s what I decided to use.
It’s taken me about a week to sook all the content of this blog off Tumblr and regenerate it with Hugo and host it on my own server. That week has been one of the most tedious, repetitive and downright boring I’ve spent in a long time. I can take the odd boring task on the chin most of the time but, given that the whole point of computers is to enable us to quickly and accurately accomplish repetitive tasks, I find it ten times as annoying when I have to do some moronic repeating task on a computer than I do in the ‘Real World’. I keep thinking “Fucking computer. You can see what I’m doing over and over again here. Why can’t you do it for me?!”
I won’t go into all the details of the painful tomrent I’ve just been through, as it’s still too fresh in the mind, but a few bullet points should give a flavour.
Hugo’s Documentation is Really Bad –Hugo itself is great. Although I’ve still only scratched the surface, I’m loving it so far and looking forward to getting ‘in up to my elbows’ in due course. But the user manual is awful. It’s presented professionally enough and looks great but the trouble is, it’s not very clear. One thing that contributes to this is the sheer wealth of options and ways to do things in Hugo. For example, your various configuration files can be written in your choice of three different markup languages; JSON, YAML, or TOML. Great! –choice is a good thing. But unfortunately the code examples given in the user docs leap about from one to the other. So, for one task, you’ll be shown the correct syntax in TOML, for the next it’ll be in YAML and then the one after that will be in JSON. So you have trawl the internet to find the equivalent syntax in whichever one you’ve opted for.
Hugos’s Documentation is Really Bad –Did I mention that before? In addition to the inconsistent examples given in the documentation, you also get the impression that parts of it were written by committee [Hugo is an open-source project, so this is likely true]. Whilst some of the documentation is elegantly and concisely written, other parts are [often subtly] more opaque. There were certain sections I still didn’t quite ‘get’, even after reading several times.
Hugo has no Import Scripts –In a lot of cases that would be a deal-breaker for me. One of my pet hates is software writers who don’t give you a straightforward way to get your stuff IN and OUT of their product. I think it smacks of collossal arrogance to assume that anyone who comes to your product is either completely new to that ‘type’ of application, or will be so overwhelmed by how good your ‘thing’ is that they’ll completely abandon all the ‘stuff’ they’ve created in your rivals’ products, over the preceding months and years. However, the Hugo docs recommended that wannabe switchers use Jekyll’s [another SSG] import scripts, as Jekyll uses a fairly similar setup to Hugo. So I decided to give it a go.
Jekyll-import Doesn’t Work Very Well –I used the Jekyll-Import script to import my blog from Tumblr into Jekyll format and then embarked on what I hoped would be the relatively simple and quick process of making the few tweaks necessary to convert it into a format Hugo could work with. In practice, this turned into the four or five days of mind-numbingly boring repetitive slog I’ve mentioned above.
For a start, Jekyll-Import did not import my images properly. there were various switches and options within Jekyll which were supposed to enable this, but whatever combination I tried, it didn’t work properly. The best I got was a folder of images imported from Tumblr, but all the image references within the text of the posts were still linking to the original URLs on Tumblr.
Likewise with my post ‘Tags’. Jekyll-Import imported these into each post as a long list of words, separated by hyphens. Hugo [in the TOML config I was using] wanted them in quotes, comma separated inside square brackets.
There were dozens of other anomalies like this: Broken Markdown tags, due to the introduction of extraneous spaces here and there. Broken bullet lists, due to similar stray spaces at the beginning of lines, randomly commented out pieces of text, etc, etc.
In the end, I had to go through each one of my posts individually [176 of them in all!], manually tweaking and fixing each one and also correcting the image links so that they pointed to local copies of the images, rather than the ones still on Tumblr. I also had to visit Tumblr and download several of the images which had mysteriously not been downloaded by Jekyll-Import. While I was at it, I availed of the chance to rename all my local images to something a bit more relevant to their containing post, as their Tumblr names were monstrosities like 45tv234456g3ye4q5b1y2y.jpg
PHEW! –If I’d had an inkling of what a complete and utter ball-ache that was going to be, before I started, I don’t think I would have bothered. But it’s done now and all my former Tumblr posts are safely converted to Markdown with TOML configuration headers and all my ‘assets’ are saved locally. All my assets that is apart from embedded videos, which are still either on Vimeo or YouTube. Eventually I’d like to grab them myself too, so I can be completely free of dependencies on other sites. But I think I’ll leave that for another day, lest I lose what’s left of my sanity.
At the moment this site is a bit of a mess visually: I’ve just knocked together a very quick theme in Hugo, which makes it look superficially somewhat like the old one, but I’ve not done anything yet to address how I’m goingh to deal with my images. Many of them were embedded in the old Tumblr posts as slideshows, so now they’re all just arrayed in a long ugly line down the page here. But at least I’ve got the ‘grunt work’ out of the way, by getting my ‘stuff’ out of Tumblr. Now the more creative fun can begin!
[Incidentally, some of the old posts imported from Tumblr are irretrievably broken. For a while in the past I used a free image storage service called Droplr to host images embedded in my blog posts on Tumblr. Then one day the feckers turned round and said that all the free accounts were cancelled and follks would have to pay to retain access to their images. Needless to say I told the shifty bastards to fuck off but, unfortunately it means some of the old posts have permanently lost their illustrations. Oh well. Another example of the folly of relying on other people/companies to host your content for you. From now on I’m making sure i’ve got my own independent alternative!]