Page Not Found Locally After Deploying Hugo Site to GitHub Pages

Hello,

I’ve created a system that generates a Hugo site and deploys it to GitHub Pages using GitHub Actions.

  • The site works fine on GitHub Pages (online).
  • However, locally, when I run hugo server, I get a “Page Not Found” error.

What I’ve tried so far:

  • I’ve updated the baseURL in config.toml to match my local environment (http://localhost:1313/).
  • I’ve created a new post, but still get the “Page Not Found” error.

I am able to deploy to GitHub Pages without issues, but I cannot view the site locally.

Repository:

Here’s the link to the GitHub repository I’m working with:

And here the webpage

you are

  • using the theme blowfish as a submodule, so you have to make sure you pull that, too
  • your site is deployed to a subfolder, so you have to browse it from there

I did:

git clone https://github.com/wilonweb/test-template.git --recurse-submodules topic-54789

and it displays fine when browsing to:

http://localhost:1313/test-template/
1 Like

Thanks a lot !!!

So i have to use the flag --recurse-submodules because i use a theme as a submodule ?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.