Today I completed the second migration of my website from Blogger to Hugo (previously from a drag-and-drop platform to Blogger). The main motivators were syntax highlighting in code snippets, site performance, and multilingual support for translation to Spanish.
Syntax highlighting#
Previously, with Blogger, I was using the compose mode to edit my blog posts. When I wanted to show source code, I simply formated the snippet with a monospaced font. I knew that I could have added highlight.js in my site template, but switching from compose to HTML mode was a show-stopper for me.
Now with Hugo, I can simply use the code block syntax (```
), specify a language (like Java, SQL, Bash, and many others), and the website will show the code snippet with nice syntax highlighting and even with a useful button to quickly copy the code. For example, in my markdown file I can type:
```java
public static void main(String[] args) {
System.out.println("Hello Hugo");
}
```
And Hugo will render it like:
public static void main(String[] args) {
System.out.println("Hello Hugo");
}
Site performance#
A second motivator was speed. My website is composed mostly by static pages. It should be a super fast website. I felt that Blogger wasn’t as fast as I wanted and I had been eying and even trying static site generators like Gatsby and others. These generators allow you to focus on content creation using, for example, markup syntax and usually have plenty of integrations and themes.
Image processing was another big factor in making the site faster. Image sizes are optimized when you build the site. A welcomed feature when you care about performance.
Why Hugo?#
I decided to go with Hugo ( no pun intended) because of its simplicity and performance. It had all the features I wanted:
- Markdown for creating blog posts
- Comment system
- Customizable URLs for easier migration from Blogger
- Responsive themes with dark/light variants
- One click deployment (git push)
- i18n
- Multilingual support
Hugo will be my first option in the future for static website like product documentation.
Conclusion#
Migrating the website took some hours of research and evaluation, some more hours performing the actual migration of data on localhost (from an XML export to markdown files), and some hours deploying and updating DNS records correctly.
Let me know in the (also new) comments section what you think. All feedback is welcome.