Hugo Benefits and Issues

Published: | Updated: | by Julian Knight Reading time ~3 min.
📖 Kb | 📎None | 🔖None

A discussion of Hugo vs Jekyll and WordPress.

Benefits of Hugo over Jekyll 🔗︎

  • Simple binary install for local builds.
  • Far easier to build a site, even from a blank theme.
  • Shortcodes - gist, ref and relref, speakerdeck, tweet, vimeo, youtube. Plus the ability to create your own very easily.

    Examples: spf13, Hugo Docs.

  • No need to faff with escaped Liquid tags - makes embedded code examples a LOT simpler.

  • Seems to have far more logical and useful variables such as the .Parent, etc for shortcodes.

  • Migration of old sites is made much easier due to aliases and url frontmatter fields.

  • Use archetypes to template creation of new pages/posts/etc

  • Aliases - Why don’t other site generators use this!! Great for migrating sites. You can supply any number of aliases and Hugo will generate a redirect page automatically - no more 404 errors when migrating.

  • Wordpress migration - it actually works. Not only that but it creates sensible url and date metadata. The Jekyll equivalent never worked for me.

Disbenefits of Hugo over Jekyll 🔗︎

  • Cannot use variables in page/post content. Have to use a shortcode.

Converting from Jekyll 🔗︎

  • Change all instances of updated in frontmatter to lastMod

Converting from Wordpress 🔗︎

  • Some posts didn’t get a title frontmatter. They were all draft articles.
  • Some posts didn’t get a proper date (1970-01-01)
  • The excerpt field used in WordPress was not converted. It still appeared in the frontmatter. I manually (well vscode file search/replace) converted these to descriptions.
  • Link tags came across as HTML rather than markdown. Not too big an issue except many didn’t have nofollow on them. Probably that’s carried from the original though.
  • Code sections came across wrapped in HTML <code></code> tags instead of GitHub markdown codefenses or Hugo’s highlight tag.
  • Pages need tweaking, especially to reproduce the same custom navigation menu.
  • No dynamic data (Pods, WP-Pipes, Express Curate, Feedburner redirect, Twitter mentions as comments) - have to do this some other way or not at all.
  • No automation: tag/category lookups/suggestions, no auto-dates, no auto-SEO, no auto-share
  • No search
  • No PODs (Custom data & forms) - have to export to JSON, add the json to the data folder, create a shortcode to display.
  • Export from WP created a frontmatter var of dsq_thread_id as a list, this needs changing to disqus_identifier and making text in order for it to be used by the internal Disqus template.
  • My export had some leftover frontmatter URL’s in the form blogger_permalink from when I merged to Blogger blogs. I renamed these as aliases.
  • Draft posts came across with 1970 dates and URLs in the format ``, I removed all of the URL’s for these.

General “Gotcha’s” 🔗︎

  • When using a partial, make sure to pass “.” as a parameter othwise the partial does not get any context variables.

    e.g. {{ partial "partialname.html" . }}

  • When using hugo server, pages and other resources that are moved or deleted MAY not be released by the live reloader. May need to stop/restart the server for them to actually disappear.

  • Site and page variables are defined without leading caps. But they are used with leading caps.

  • lastMod in a page frontmatter is actually used as .Page.Lastmod - note the change of case!

    Honestly, this kind of thing really puts people off.

comments powered by Disqus