We provide a starter theme template for you to create a HB site quickly.
1git clone --depth 1 https://github.com/razonyang/hb-theme blog
2
3cd blog
The blog is the local directory, change it at will.
Firstly, we need to change the module path located in go.mod, replace the module github.com/razonyang/hb-theme with your own, such as module github.com/user/repo.
1sed -i -e 's/module\ github.com\/razonyang\/hb-theme/module\ github.com\/user\/repo/' go.mod
1git add .
2
3git commit --amend
Modify the commit message, such as First commit.
1git remote set-url origin https://github.com/user/repo
1git push origin main
If you’re located at China mainland without VPN, the Hugo module download may fail.
There are two proxies for this: GOPROXY.CN and GOPROXY.IO.
1export HUGO_MODULE_PROXY=https://goproxy.cn
GOPROXY env var, please use HUGO_MODULE_PROXY instead.You can also set the module.proxy instead of using env var.
hugo.toml
1proxy = 'https://goproxy.cn'
hugo.yaml
1module: null
2proxy: https://goproxy.cn
hugo.json
1{
2 "module": null,
3 "proxy": "https://goproxy.cn"
4}
1hugo server --gc --disableFastRender