Deploying to Github Pages


A quick summary of deploying this Hugo generated site to Github pages (and hence hdyson.dev) via the instructions from the Hugo docs.

To summarise:

  1. Create source (arbitrary name) and deployed (name must be <username>.github.io for Github pages) repos on Github.

  2. Clone the source project. Note the baseURL in the config should point to the Github URL even when making the site available via a different URL.

  3. Add content.

  4. Add the built (by default, ./public) folder as a submodule, pointing to <username>.github.io:

    git submodule add -b master git@github.com:<USERNAME>/<USERNAME>.github.io.git public
  5. Add and run the deploy.sh script.

  6. Finally, tweak the deployed repository settings as per the Github instructions.

See also