Migrate Blog from Hexo to Hugo

· 2 min read · 299 Words · -Views -Comments

I’ve used Hexo for 9 years. While Hexo is still alive, themes are scarce, the visuals feel tired, and customization costs are high. Over the holiday, I decided to try migrating to Hugo.

https://static.1991421.cn/2025/2025-04-30-202206.jpeg

Steps

Install Hugo

brew install go

brew install hugo

Note: newer Hugo versions can sometimes cause errors. When using HugoBlox, I hit startup errors. The fix was installing hugo@0.134.2. If you see odd issues, try downgrading.

Use HugoBlox

HugoBlox is a higher‑level framework that simplifies theme customization and feature development. It’s flexible and feature‑rich.

Visit the HugoBlox template gallery and pick a theme. Paid themes don’t have an Edit button and must be purchased. I chose a free theme and clicked Edit, which jumps to GitHub. There, create a repo from the template. Once created, proceed with theme configuration.

Theme customization

Clone the repo locally. Refer to the official docs for simple customizations.

Examples:

  1. Enable site search
  2. Set favicon
  3. Configure share buttons …there are many options.

Migrate Hexo posts to Hugo

After theme setup, migrate posts. Since my site has run for years and URLs are indexed by search engines and other platforms, I need to keep URLs stable. That requires some work:

  1. Change Hexo frontmatter descriptionsummary.

  2. Change Hexo frontmatter addrlinkslug.

  3. Adjust Hugo permalink rules:

    permalinks:
      blog: '/:year/:month/:day/:slug/'    # Output: /2025/04/30/my-post/
    

Additional notes

Installing an older Hugo

Package managers like Homebrew may not provide older versions. If you hit the version issue above, install manually. Download a specific release from GitHub. For macOS, grab the darwin-universal.tar.gz archive.

https://static.1991421.cn/2025/2025-05-01-165752.jpeg

Copy the binary to your PATH:

 mv $HOME/Desktop/hugo_0.134.0_darwin-universal/hugo /opt/homebrew/bin/

You may see a security warning; allow it under Privacy & Security. Then hugo version should work.

https://static.1991421.cn/2025/2025-05-01-170705.jpeg

Final Thoughts

That completes the migration — total time: one day.

References

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover