John Siu Blog

Tech - Business Tool, Personal Toys

Hugo Empty Homepage

☰ Table of Content

Hugo homepage list empty or wrong post list after upgrading to 0.57.x.

TL;DR

If your hugo blog/site homepage list suddenly become empty or display the wrong list, check your hugo version:

1
hugo version

Output:

1
Hugo Static Site Generator v0.57.1/extended darwin/amd64 BuildDate: unknown

If it show > v0.57.x, then it properly is the cause. As Hugo team introduce some breaking changes when upgrading to 0.57.x. 1 2

Quick Fix

New features are great but keeping the site up and running is more important.

It is easy fix for linux, just install hugo 0.56.3 with package manager of your distro.

However it is a bit messy on MacOS with Homebrew. Following is the steps for rolling back on MacOS using Homebrew:

1
2
3
4
brew uninstall hugo
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
git checkout 89a374 hugo.rb
brew install hugo

If you have a different brew formula path, check below for how to locate it.

Now your Hugo is rollback to 0.56.3. Switch to your hugo site directory and everything should back to normal.

Brew Rollback Explain

To find the exact location of hugo.rb.

1
mdfind hugo.rb

If you have brew recent version, it should show path as follow:

1
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hugo.rb

Go into directory and check hugo.rb git log:

1
2
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
git log hugo.rb

Look for entry right below 0.57.0 in output:

commit 89a37417b5efc8054fad9a0ea95f48f944b36f6e
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date:   Thu Aug 1 15:37:59 2019 +0000

    hugo: update 0.56.3 bottle.

The commit string (SHA-1 checksum) is 89a37417b5efc8054fad9a0ea95f48f944b36f6e. We use the first 6 characters of it for check out:

1
git check out 89a374 hugo.rb

Now you have Hugo 0.56.3 bottle file in your system. Brew will use it when you try to install Hugo.

Long Term

Above fix is only for short term and to get your site back. In the long run you should update the theme to use new Hugo features. Especially if you are maintaining a huge site with multiple sections.

Hugo Theme Page

If your theme is one in Hugo Theme page, check if it is updated. Hugo development team is actively contacting all theme authors to migrate2.

Reference

John Siu

Update: 2020-08-28
comments powered by Disqus