Add hugo to github.io page

Hi!

I want to host hugo on my github io page. I added: baseURL = “https://username.github.io
with my username in config.toml file. Then I pushed the site, but it doesn’t work and gives me 404 not found. Anything else I need to do?

Hi there – have you followed the hugo docs for hosting on github pages?

Nope I saw that one now. What I did was clone hugo into a folder and change everything there, it worked to run it locally. Then I cloned the githu.io repo, moved all files from the other folder to the github.io folder, and I ran:
git add .
git commit -m “push new site”
git push

But only some files was pushed so seems to be some problem. Is the easiest thing to redo it and follow the link you sent? Because I didn’t do anything with submodule, and it might be some problems when using git a lot for pulling down Hugo repo and then move files. Or could I fix the problem in any way?

Doing it your manual way, I’m not familiar enough with GitHub pages to advise.

But I do know that following the steps in the docs works.

For GitHub Pages, you can:

  • use the master branch as website or
  • use the docs folder of the master branche as website or
  • use a gh-pages branch

My favorite solution is the docs folder. Please configure in your project Settings page.