Which folders to upload when hosting hugo website on Github?

I have created a blog using Hugo and hosting it on GitHub — Posts | Curioage . I am confused about which folders I should upload. For now, I have uploaded everything, but I think just uploading the public folder is sufficient. Any suggestions?

GitHub: GitHub - curioage/curioage-blog: My Blog

looking at your repo, there’s an action to build and publish your site. (last run 8month ago matching the last commit). So seems your online version is published with the action.

Then it’s just the other way round: Store the sources only and not the generated files.

  1. clean up your repo

    git rm -rf public/
    git rm .hugo_build.lock
    
  2. looks like you don’t use git submodules. You mioght want to clean that up:

    git submodule deinit --all
    rm .gitmodules
    
  3. add a .gitignore file to exclude all generated stuff

    public/
    resources/
    .hugo_build.lock
    
  4. commit this to clean up the remote

    git add -A
    git commit -m "cleanup repository"
    git push
    
  5. align your Hugo versions to be the same locally and remote

  • last local build was with 0.123.7
  • your site is published with 0.137.1 (defined in the workflow)
1 Like

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