As announced in my last post, I have been working on the conversion of my website to a static site generator. My tool of choice was hugo. It is quite fast and I’m very happy with the process overall. However, other static site generators like Jekyll or Pelican may be working equally well and I wouldn’t know.
Today, I deployed the first version of the new website and you can (hopefully) see it live.
The conversion process
Some of you may be interested how I converted the website and how long it took.
As it goes, using a static site generator had been on my mind for quite a while. I probably considered using Pelican as early as 2015. Yes, I do understand that still wouldn’t make me qualify as early adopter.
There was no proper time estimate on this project. I guessed it would take “a couple of days”. And it somewhat did. Not counting interruptions from unrelated work, it probably took one week.
How? The “ingredients”
I used a Wordpress plugin to export my posts to Markdown: Ben Balter’s Jekyll Exporter. That plugin worked quite well for most things. There were issues with some images and with my publications that I had auto-generated via PHP. I slowly imported the posts into the new page, adjusting the meta data and fixing some formatting. That took the better part of 2 days.
For the plumbing, I looked at many hugo themes but none of them did exactly what I wanted. In the end, I took Yihui Xie’s XMin template as a basis and added bootstrap on top of that. I then adjusted many things manually on the HTML level. This must have taken at least 1 day.
I’m a bit familiar with front-end web development but I don’t have the patience (or the taste) for selecting colors. Therefore, I mainly experimented with color variants of bootstrap from bootswatch. Although that kept my analysis paralysis somewhat at bay, I probably still spent a day here at least. In the end, I deployed the bootstrap default colors. Maybe I’ll adjust them in the future maybe not.
More time than expected was spent on the following challenges that appeared “out of nowhere”.
- Improving and rewriting texts
- File layout. Github #1768: It is still challenging to serve markdown and image content from the same directory. I find that acceptable but unfortunately it was not immediately obvious and I attempted the impossible for a while.
If you are contemplating such a conversion, I’d still strongly encourage you to go ahead. I’m delighted that all my writing is in markdown now, making it easy to store and very unlikely to get lost. The styling of the page was also much easier to understand for me than in Wordpress. However, Wordpress came with so many templates out of the box that I simply found one that worked for me. Many benefits, like easier deployment, I still have to reap.
If you are wondering about Hugo in particular, I don’t have a conclusive result. I have not tried alternatives but I also don’t see a need to look around.
For further inspiration and advice, I suggest you take a look at the following articles.