Hugo Quickstart Tutorial works locally, but when deploying to Github+Netlify did not load content

I followed the Quickstart Hugo tutorial and it worked locally via localhost. However, When I deployed via Github+Netlify, the content would not work. The Ananke Theme/CSS was visible though. It was just the content of my-first-post.md that was missing.

These are the tutorials I followed:
Quickstart Hugo
Hugo deploy on Github+Netlify
How I pushed my repository to Github

hi there,

in order to help you, we’d need to know the netlify instance name for your project at the very least, and also any build errors you received. When you say “did not work”, what do you mean, specifically?

Hi Perry, there were no errors on the build. The netlify instance is this:
https://5e3090cc9448eda110f332d1--festive-archimedes-85e51c.netlify.com/

When I said it did not work, I meant the content did not load. Below is a screenshot of my localhost vs netflify deployment. As you can see, the content is missing on netlify’s page.

let’s run through some sanity checks:

  • did you commit and push the changed files since you made the changes?
  • are your netlify settings pointing to the right publish directory?
  • did you check your build log in the Netlify dashboard and see if there are any errors?

It would be great if you could either link us to your build logs or copy/paste them in here so we can check (if the 3rd point i mentioned does indeed show anything)

Hi Perry, Here are my answers to your questions:

  • Yes, I committed and pushed the changes to my Github
  • Yes, I believe my netlify settings point to the right publish directory
  • Below is a link to my Netlify build. Unless if I’m not looking at it correctly, I don’t think there are any errors.

Hi,

It looks like you pushed your public directory to the GitHub repository. When Hugo runs on our build pipeline, your public directory gets overriden with that empty index.html file.

To make it work, you need to create a template for the index page that reads the content from the content directory when we run hugo in our build pipeline. You can read more about the homepage template here:

1 Like

Thanks @calavera!

Anyways, I found the culprit: "Drafts do not get deployed; once you finish a post, update the header of the post to say draft: false "

After setting the post to say draft: false , the content is being generated now!

Hi @observingnetlify, just noticed your post. Did you encounter similar issues to mine as described here?

Is anyone else having similar kind of problems? Thanks!

Hi, @ng0177, I see @jen has answered the most recent questions in that other topic. If there are more questions, we’ll follow-up there.

i had this same issue, what happened to me was that I had set draft = true into the _index.md. Changed it back to false and everything started working again.

1 Like

Hi,

disclaimer - I’m pretty new to website programming but do know my around computers. So apologies in case I’m asking beginners questions :slightly_smiling_face:

I’ve setup a site using hugo template vex-hugo and deployed it via github and netlify - love all three tools.

My problem is on localhost both homepage and subpages load normally. Once I deploy it to github&netlify only the homepage works regularly. The subpages only show white pages.

So far I’ve checked that

  • my netlify settings are pointing to the right publish directory
  • the build log in the Netlify dashboard doesn’t have any errors

I’m attaching the deploy details - Netlify App and the website address - www.spinenuances.com in case my description of the subpages only loading white space doesn’t make sense.

I found this thread and am hoping you guys will be able to help.

Thank you!

Hi,
please disregard my above question I’ve found the solution in the meantime.
I forgot to add the new domain the content.toml file when deploying and therefore all content data could not be found.
What I still don’t understand is why the homepage loaded with this error without problems but that’s really just a nice to have!

1 Like

Hi,
I am facing the exact same problem. I was using the parsa-hugo theme. In my initial deploy everything was working fine. I cloned the repo and made some changes to add authors content pages to the website. The blog is working fine locally. So I pushed the changes and deployed it to netlify. Now, no content page is being loaded. The homepage and all other layout elements work, but the content pages don’t load. I have the right domain in the config.toml file. I don’t see a content.toml file.

My repo

Deploy Details

Hi there, @Attreq :wave:

Thanks for reaching out, and sorry to hear you have encountered this. Did you follow any of the above solutions that have been shared? If you are still encountering this let me know :slight_smile: