Getting Started
Generating a static website
- Install Hugo Static Website generator
- Hugo new site “Website name”
- Use a theme as the backbone of the site
- Follow Hugo doc to add default theme
- Or create your theme from scratch
hugo new theme "theme name"
Hosting the website
Using Github Pages for public repositories
- Go to your repository settings on Github
- Go to the “Pages” section
- Select “Github Actions” as the source for the build and deployment
- Copy the official Hugo documentation Github workflow in a new file
- Filepath: .github/workflows/hugo.yml
- Update the hugo.toml baseURL to fit you github account path : https://“account name”.github.io
- For our website, it deployed the website to https://SimpleOpenSource.github.io/simpleopensource.com
Use custom domain
- Add a CNAME record to your provider
- Name = “@” or domain name
- Content = github base url such as “simpleopensource.github.io”
- Add another CNAME record
- Name = “www”
- Content = github base url such as “simpleopensource.github.io”
- Add a Page Rule
- URL = www.“domain name”.com/*
- Parameter = “Always use https”
- Enable Full SSL/TLS encryption for the domain
- Add a CNAME to your repository
- Create a file named “CNAME”
- Add the domain name such as “simpleopensource.com”
- Access Github repository settings
- In the “Pages” section, enter your custom domain name such as “simpleopensource.com”
Your website is now available at your custom domain with free hosting!
- Be careful not to generate too much traffic or Github will stop the hosting. See documentation