Hugo on Github Pages example
An example Hugo site that is hosted on Github Pages.
Getting started
Preparation
Install Hugo following Hugo documentation.
# Clone this project
❯ git clone https://github.com/mnishiguchi/hugo-gh-example.git
# Move into the project directory
❯ cd hugo-gh-example
Development
# Move into site directory
❯ cd site
# Start a Hugo development server
❯ hugo server
Visit http://localhost:1313/hugo-gh-example/
Hosting on Github Pages
- Adjust
baseURL
insite/config.yaml
using your Github username, likehttps://<username>.github.io/<repo-name>
. - Create a Github repo for your site.
git push
, then the Github workflow defined in.github/workflows/gh-pages.yml
will do all the heavy-lifting for Github Pages.
The site URL will be https://<username>.github.io/<repo-name>
.
That's it!