Solved: Hugo Not Showing Posts on Netlify Issue

12 September 2019

Background

Recently, I’ve switched one of my blog site from Wordpress to Hugo hosted on Netlify.

I ran into an issue where on my homepage, the list of posts were not showing up.

This is what it should look like:

Cha Nom Thailand 1st

After switching to Hugo, when testing on my localhost, it showed the posts fine.

After I deployed to Netlify with the build settings like below, it does not show any of my posts any more on the homepage.

Netlify CD

After some digging I went to see the deploy log and noticed that the Hugo version on Netlify was outdated.

On my local the Hugo version is 0.58.0 and on Netlify it’s still at 0.54.0.

Solution

I needed to make sure Netlify uses the same Hugo version I’m using on my local.

To solve this issue, I added a netlify.toml file in the root folder of the project. Where package.json, config.toml or .gitignore would sit.

Within the netlify.toml, I specified the version for Netlify to use in this way:

[context.production.environment]
  HUGO_VERSION = "0.58.0"

Change the version number as needed.

My posts now show up on the homepage of my website: https://chanomthailand.com


Jeff Bocala © 2021. This portfolio site is built with Next.js.
🇦🇺🦘