Hugo

[SOLVED] Roll back to a previous hugo version?

MacOSX 10.13.2
Hugo Static Site Generator v0.36 darwin/amd64

I was recently hired to perform some updates on a clients hugo site (I’ve never used hugo before). After following the installation guide and running the server command the site was able to render index.html but all other pages returned 404.

I reached out to the client (who is non-technical) because he has the site running locally from when his original developer had him editing markdown files locally.

Client is able to run the site locally and all other pages render as expected. After some trouble shooting it appears that the only difference in our set ups is that he was running hugo 0.27 whereas I’m running 0.36.

So my question is how do I rollback hugo to 0.27?

Additionally what changes need to be made to my codebase to get the clients site using the latest version of hugo?

Impossible to give a general answer to.

To rollback you need to replace the hugo binary file with an old version.

1 Like

You grab 0.27 from the Hugo releases archive on Github and install it locally to genarate the site.

Then read the Docs regarding deployment. There are various ways to deploy and I don’t know what setup is currently used.

To update to the latest version the terminal is your only friend. Are there any errors? If yes searching the forum and the docs will help you remedy the situation.

Also it would be best to read up the Release notes since version 0.27 and try out different newer versions to see when the project started to fail.

1 Like

I was able to get my project working by rolling it back to a previous version.

To rollback you need to replace the hugo binary file with an old version.

I wasn’t sure how do that exactly so I followed this guide.

tl;dr

  1. Uninstall old brew installed version of hugo: brew uninstall hugo --force
  2. Find homebrew-core/Formula/hugo.rb file within the corresponding version (in my case 0.27
  3. Click raw inside of github to get a raw plaintext version of hugo.rb
  4. Use that web address with brew install: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/b6a6d50ee2b69721647069e7db435d634a858213/Formula/hugo.rb
  5. Confirm install with hugo version
1 Like

Discourse will only let me post one link per post, so here’s the link to all of the versions of hugo listed on homebrew:

For each update there’s two items:

  1. hugo: update x.xx bottle.
  2. hugo x.xx

I used the item hugo: update x.xx bottle and that worked for me, but your mileage may vary

If you use brew on Mac there is an easy way

brew switch hugo 0.27

then when you are ready, any hugo version you installed

brew switch hugo 0.36

and so on …

5 Likes

Thanks! I had no idea that was possible

Do you know if I could do this with snap too? Thank you