How to host Hugo on a Github user page ?
- Create a project
<YOUR-PROJECT>on github (e.g.hugo-blog) which contains Hugo’s content - Create an other project
<USERNAME>.github.io(e.g.youvann.github.io) in order to deploy Hugo website - Clone
<YOUR-PROJECT>,cdto<YOUR-PROJECT>and create / add Hugo’s content - Make sure your website works by running
hugo server - Delete
publicdirectory if needed (rm -rf public) - Set the remote origin of
publicdirectory tossh://git@github.com/<USERNAME>/<USERNAME>.github.io.gitby creating a submodulegit submodule add -b master https://github.com/<USERNAME>/<USERNAME>.github.io.git public(e.g.git submodule add -b master https://github.com/youvann/youvann.github.io.git public) - Launch
hugocommand in order to generate your website (publicdirectory will contains your resources) - Then,
cd public
git add .
git commit -m "rebuilding site"
git push origin master