Featured image of post Switching from Pelican to Hugo

Switching from Pelican to Hugo

You’ll notice my blog has a fresh look. I recently switched from Pelican to Hugo, and I’m thrilled with the outcome. Although familiar with Hugo, this project provided my first real opportunity to use it. Thanks to the support of a few friends, the migration only took a few days.

What Prompted the Migration?

Pelican has been my trusted static site generator for a long time, consistently delivering excellent results. However, lately, I’ve been grappling with PIP dependency issues. For instance, one plugin’s requirement of an outdated sub-dependency version clashed with other plugins. Troubleshooting this turned out to be a complex endeavor, leading me to explore Hugo as an alternative.

Adding to my decision, I realized my current theme was no longer supported. The developer had transitioned to Hugo, leaving me with an obsolete theme.

Finally, the JavaScript library I relied on for indexing and search functionality was also stagnant in terms of updates and support.

The Migration Process

Both Pelican and Hugo are static site generators that use Markdown for content. This commonality simplified the migration process considerably. However, due to differences in Markdown syntax and front matter (metadata within Markdown files) between the two, I opted to create a script to streamline the conversion.

The complete script is available here: https://gist.github.com/andreagrandi/0a7bf6e217d6561b00b6a5de6211ddaa. Keep in mind that it’s tailored to my specific blog structure in both Pelican and Hugo. While it may not directly apply to your situation, it can serve as a useful starting point for your own Pelican-to-Hugo migration.

Content migration aside, a significant chunk of time was devoted to selecting and customizing a new theme. My limited CSS knowledge meant a steep learning curve. While I’m still refining the appearance, I’m content with the current state.

One less thing to worry about is the search functionality, which is seamlessly integrated into the new theme.

Finally, I rewrote the CircleCI configuration file to accommodate Hugo instead of Pelican. This involved some trial and error but was ultimately successful.

Reflections on the Migration

The entire experience has been positive. My site is now easier to manage, and dependency issues are a thing of the past. I’m pleased with the new theme, even though I have minor adjustments planned (like addressing the non-functional comments section). Looking back, I wish I had made the switch sooner.

I hope you’re enjoying the refreshed look! Please don’t hesitate to reach out if you come across any issues.

Licensed under CC BY-NC-SA 4.0
Last updated on Sep 18, 2022 23:28 +0100