This article refers to the modern, up-to-date installation method of installing the theme locally as 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.

1$ export HUGO_MODULE_PROXY=https://goproxy.cn
bash

Please note that, Hugo doesn’t respect the GOPROXY env var, please use HUGO_MODULE_PROXY instead.

You can also set the module.proxy instead of using env var.

config.toml

1[module]
2  proxy = 'https://goproxy.cn'
toml

config.yaml

1module:
2  proxy: https://goproxy.cn
yaml

config.json

1{
2   "module": {
3      "proxy": "https://goproxy.cn"
4   }
5}
json

Install a new site from scratch§

Please use the starter template for your new site.

Install on an existing site§

Turn your existing site into a Hugo module§

1$ cd my-blog
2$ hugo mod init github.com/me/my-blog
bash

Declare hugo-theme-bootstrap module as a site dependency§

1$ hugo mod get github.com/razonyang/hugo-theme-bootstrap@[version]
bash

The [version] can be one of Releases, branches or even commits.

Replace [version] with master for getting latest changes.

Copy example site content into your site (Optional)§

  • Clone the hugo-theme-bootstrap-skeleton repo into a temporary directory:
1$ git clone https://github.com/razonyang/hugo-theme-bootstrap-skeleton /tmp/hbs-skeleton
bash
  • Copy example site configuration and content into your site:
1$ mkdir config
2$ cp -a /tmp/hbs-skeleton/config/* ./config
3$ cp -r /tmp/hbs-skeleton/content/* ./content
4$ cp -r /tmp/hbs-skeleton/archetypes/* ./archetypes
5$ cp -r /tmp/hbs-skeleton/static/* ./static
6$ cp -r /tmp/hbs-skeleton/assets/* ./assets
bash
  • Delete the repo from your temporary directory again:
1$ rm -rf /tmp/hbs-skeleton/
bash

Pull in dependencies via npm§

  • Use node package manager npm to pull in dependencies for this theme:
1$ hugo mod npm pack
2$ npm install
bash

Preview your site§

  • Start hugo’s built-in webserver to preview your website:
1$ hugo server
bash