add more details on about gh-pages and baseURL on hosting-on-github.md (#1346)

* add more details on about gh-pages and baseURL on hosting-on-github.md

* Update content/en/hosting-and-deployment/hosting-on-github.md

Co-authored-by: Shohei Ueda <30958501+peaceiris@users.noreply.github.com>

* Update content/en/hosting-and-deployment/hosting-on-github.md

Co-authored-by: Shohei Ueda <30958501+peaceiris@users.noreply.github.com>

Co-authored-by: Joe Mooring <joe@mooring.com>
Co-authored-by: Shohei Ueda <30958501+peaceiris@users.noreply.github.com>
This commit is contained in:
Vincent Liao 2021-11-30 13:04:18 +07:00 committed by GitHub
parent 3bd0b46dc5
commit a58541f495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -86,6 +86,16 @@ jobs:
For more advanced settings [actions-hugo](https://github.com/marketplace/actions/hugo-setup) and [actions-gh-pages](https://github.com/marketplace/actions/github-pages-action).
## Github pages setting
By default, the GitHub action pushes the generated content to the `gh-pages` branch. This means GitHub has to serve your `gh-pages` branch as a GitHub Pages branch. You can change this setting by going to Settings > GitHub Pages, and change the source branch to `gh-pages`.
![Screenshot of the github pages setting for setting source branch](/images/hosting-and-deployment/hosting-on-github/set-correct-branch.jpg)
## Change baseURL in config.toml
Don't forget to rename your `baseURL` in `config.toml` with the value `https://<USERNAME>.github.io` for your user repository or `https://<USERNAME>.github.io/<REPOSITORY_NAME>` for a project repository.
Unless this is present in your `config.toml`, your website won't work.
## Use a Custom Domain
If you'd like to use a custom domain for your GitHub Pages site, create a file `static/CNAME`. Your custom domain name should be the only contents inside `CNAME`. Since it's inside `static`, the published site will contain the CNAME file at the root of the published site, which is a requirement of GitHub Pages.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB