A facelift for Libelli today! I moved from Jekyll to Hugo for static site generation, a move that has been long overdue — and I’m very happy I’ve done it. Not only can I take advantage of a new theme with extra functionality (PaperMod in this case) but also because Hugo is written in Go, I feel like I have more control over how the site gets generated.
A lot has been said on this topic, if you’re thinking about migrating from Jekyll to Hugo, I recommend Sara Soueidan’s blog post — the notes here are Libelli specific and are listed here more as notes than anything else.
Reasons for Switching
These are my personal reasons:
- Jekyll was getting very difficult to work with; I primarily used the
bundle exec
command, but that would fail more times than not, and because of the frequency that I was writing posts - every time I wanted to write a post I had to update a slough of dependencies. - Travis-CI was failing - I had some Jekyll CI integration, but it would fail even though my pages would be built ok; it wasn’t inspiring a lot of confidence.
- I wanted to make changes to the site, but it seemed like I had a giant obstacle of having to update jekyll and the theme first and I’m not very good with Ruby …
- Jekyll was taking a long time to build - I had 106 posts before I decided to switch and it was crawling.
- I wanted to use Hugo for other projects that I am working on.
Considerations
A few key considerations while making the switch:
- I really like Hugo’s content organization system; unfortunately that would break the permalink structure from Jekyll - the solution was aliases which allowed me to redirect the old post to the new link which I liked better.
- Along those lines, I really liked page-bundles for organizing content. It’s a bit tricky to switch with where I’m at now, but I’m going to use it in the future I think.
- I selected PaperMod primarily because of the search and archive functionality – which will make finding posts on Libelli much easier. I hope to create a theme of my own someday though.
- Deploying on GitHub pages - moving away from Jekyll means I don’t get builds for free. I’m working on using Travis CI for deployments — we’ll see if it works after this post!
- I had to write a script to deal with making changes to the frontmatter to fit my new configuration, the
hugo import jekyll
command did seem to do a lot of work, but I still had to modify theslug
and thealiases
configurations as well as bring over defaults from my posts archetype.
Tricky Bits
Unfortunately (or fortunately), <script>
tags are cleaned by the Hugo markdownify
where they weren’t in Jekyll. This meant that all my gist
embeddings had to be updated to the following shortcode:
{{< gist bbengfort foo >}}
Rather then writing a script, I went through this with find and replace.
In SVG Vertex with a Timer, however, I had actual Javascript that I wanted rendered. So I created a layouts/shortcodes/vertex_timer.html
script and embedded it as a short code in the file with:
{{< vertex_timer >}}
Finally, I had to replace all of the images that used the wrong short code format from Jekyll and replace them with absolute references to their location in the static
folder. Most of this was copy and paste, but I’m worried I missed something, hence the tricky bits!
Thoughts
It was very straight forward to move over to Hugo from Jekyll particularly because I was switching themes. I’m very much looking forward to using Hugo from here on out!