Installation

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

Installation

Install the HB theme in one minute.

Hugo server takes a long time to process on first run to download modules and process a lot of images. You may want to remove the unused images and commit the resources/images folder to improve the build performance.

Clone Repository

1git clone --depth 1 https://github.com/hbstack/theme blog
1cd 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/hbstack/theme with your own, such as module github.com/user/repo.

1sed -i -e 's/module\ github.com\/hbstack\/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, see Go and Hugo Proxy Servers for setting up the Hugo Modules proxy.

Install Build Tools

1npm ci

Please note that Go and Node.js are required, read more on build tools.

Start Hugo Server

Preview in Development Mode

1npm run dev

Preview in Production Mode

1npm run prod

What’s Next?

  • Remove the unused configurations, menus, content, images and GitHub actions (workflows).
  • Tweak configuration and parameters, such as baseURL, giscus.*.
  • Create content.
  • Deploy sites.