Switching from Jekyll to Hugo

Hugo has much faster build times than Jekyll and offers a more powerful design experience. We recommend Hugo in general for static site generation.

Conversion

Download Hugo binary

The Hugo Jekyll importer was broken for me, so I made my own Jekyll to Hugo converter

Clone a theme into your site, here we use “hugo-flex” theme

cd ~/myHugoSite

git submodule add https://github.com/de-souza/hugo-flex themes/hugo-flex

add to config.yaml a line:

theme: hugo-flex

Categories, Tags

You may need to rewrite the internal page links to categories and tags, something perhaps like:

find content -type f -name "*.md" -exec sed -i 's,](/category/#,](/categories/,g' {} +

and

find content -type f -name "*.md" -exec sed -i 's,](/tag/#,](/tags/,g' {} +

Options

I prefer using .yaml over .toml for website configuration, and you can choose with Hugo. To convert options you might see in examples between TOML and YaML etc. consider this web converter

overriding theme files

A key design pattern in Hugo is overriding theme files without editing the theme files themselves that are in a Git submodule. Use the lookup order for partials and templates. This will keep your web design clean, minimal and DRY.

Markdown syntax

Hugo’s default Markdown parser is considerably stricter than Jekyll. As a result, you may need to fix pages that don’t as strictly conform to Markdown syntax.

redirect page URL

the Hugo front matter tag aliases is equivalent to Jekyll `redirect_from

aliases:
- /old-url/