Deploying to Github pages

After a lot of pushing and pulling from Github repo, searching through this forum with similar titles and following the docs I am still not able to view my site as I can see on my local device.
Github repo.
The website when opened shows readme instead of the site. I did do ./ but it only pushed the folder but not contents as seen in the repo.
I need help in successfully deploying the site at a go.

EDIT : Will creating a local temp repository to build site work same as creating a seperate repo to host hugo files?

Okay well geez, I was able to do it with a local repo.
The deployment steps are not very easy to understand for a first time Hugo user and might help with some github action to do everything through it instead of going through countless tries.

Here’s what I did in case if someone stumbles like me and doesn’t find anser even from many such similar posts here to try this one out too.

  1. Create your standard hugo site as mentioned in the hugo docs.

  2. Once created run hugo to build your site and hugo server afterwards to verify that everything is sailing smoothly.

  3. create a folder named hugo site and run git init which will initialize a empty git repo to your local device. No need to create a github repo just to host these files although if it is suggested in the docs you can do that too but not necessary I guess.

  4. Copy the created site to the folder we just created in step 3 except the public folder(we’ll do that again).

  5. Now you are in your main site with all the hugo files as well as your site. It’s time to deploy.

  6. Create a github repo now that will host just the site and not hugo files with whatever site name you want, you can refer github pages document for more info.

  7. git submodule add -b master<USERNAME>/<USERNAME> public run this command using the info from repo the above you created. This will add an empty public folder in the directory you are working in.

  8. Create the file as mentioned in the hugo docs, you can run sudo gedit and save the contents from docs in it and then run it. link to

  9. You site is now ready to view at<USERNAME>/<USERNAME> s site page on master branch itself.

Hope this helps.

Were you able to update the site?

I mean, we are supposed to delete the public folder every time we build, but it is a submodule so, I shouldn’t delete, right?

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