New project
Before any theme setup, we need to create a Hugo project.
To achieve that, you may follow directives given on https://gohugo.io/getting-started/quick-start/ or follow below steps (in case Hugo is already installed / Go in case you intend to import this theme like recommended).
Project initialization
To initialize a Hugo project, it’s simple (this will generate a minimal boilerplate):
hugo new site <site name> --destination .
Hugo module (recommended)
To import hugo-primer theme, following properties must be added into hugo.(yaml|toml)
configuration file (on my end, I prefer yaml
format):
theme: github.com/kilianpaquier/hugo-primer
module:
imports:
- path: github.com/kilianpaquier/hugo-primer
You then can initialize go.mod
file and tidy with the following commands to download this theme as dependency (like you would do with Go):
hugo mod init github.com/<username>/<site name>
hugo mod tidy
Git submodule
If you intend to go with a Git submodule, two possibilities:
With SSH :
git submodules add git@github.com:kilianpaquier/hugo-primer.git themes/hugo-primer
With HTTPS :
git submodules add https://github.com/kilianpaquier/hugo-primer.git themes/hugo-primer
You then need to update hugo.(yaml|toml)
configuration with following property:
theme: hugo-primer
Default configuration
For an expected experience with hugo-primer theme, default configuration should be merged with your own:
_merge: deep
Start website
You are now ready to start you Hugo website:
hugo server --disableFastRender --destination dist