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.
$ export HUGO_MODULE_PROXY=https://goproxy.cn
Please note that, Hugo doesn’t respect the
GOPROXY
env var, please useHUGO_MODULE_PROXY
instead.
You can also set the module.proxy
instead of using env var.
[module]
proxy = 'https://goproxy.cn'
module:
proxy: https://goproxy.cn
{
"module": {
"proxy": "https://goproxy.cn"
}
}
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#
$ cd my-blog
$ hugo mod init github.com/me/my-blog
Declare hugo-theme-bootstrap module as a site dependency#
$ hugo mod get github.com/razonyang/hugo-theme-bootstrap@[version]
The [version]
can be one of Releases, branches or even commits.
Replace
[version]
withmaster
for getting latest changes.
Copy example site content into your site (Optional)#
- Clone the
hugo-theme-bootstrap-skeleton
repo into a temporary directory:
$ git clone https://github.com/razonyang/hugo-theme-bootstrap-skeleton /tmp/hbs-skeleton
- Copy example site configuration and content into your site:
$ mkdir config
$ cp -a /tmp/hbs-skeleton/config/* ./config
$ cp -r /tmp/hbs-skeleton/content/* ./content
$ cp -r /tmp/hbs-skeleton/archetypes/* ./archetypes
$ cp -r /tmp/hbs-skeleton/static/* ./static
$ cp -r /tmp/hbs-skeleton/assets/* ./assets
- Delete the repo from your temporary directory again:
$ rm -rf /tmp/hbs-skeleton/
Pull in dependencies via npm#
- Use node package manager
npm
to pull in dependencies for this theme:
$ hugo mod npm pack
$ npm install
Preview your site#
- Start hugo’s built-in webserver to preview your website:
$ hugo server
Comments