Installation

We provide a starter theme template for you to create a HB site quickly.

Installation

Clone Repository

1git clone --depth 1 https://github.com/razonyang/hb-theme blog
2
3cd blog

The blog is the local directory, change it at will.

Module Path

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

Push to Remote Repository

Commit Changes

1git add .
2
3git commit --amend

Modify the commit message, such as First commit.

Modify Remote Repository

1git remote set-url origin https://github.com/user/repo

Push

1git push origin main

Hugo Module Proxy (Optional)

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

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}

Preview

1hugo server --gc --disableFastRender

What’s Next?