+++ title = "Install via Hugo Module" linkTitle = "Hugo Module" date = 2022-02-26T17:10:39+02:00 featured = false comment = true toc = true reward = true categories = [ ] tags = [ "Installation", "Upgrade", "Hugo module" ] series = [ "Docs" ] images = [] navWeight = 90 authors = ["RazonYang"] +++
This article refers to the modern, up-to-date installation method of installing the theme locally as Hugo module.
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.cnPlease note that, Hugo doesn't respect the
GOPROXYenv var, please useHUGO_MODULE_PROXYinstead.
You can also set the module.proxy instead of using env var.
{{< code-toggle filename="config" >}} module: proxy: https://goproxy.cn {{</ code-toggle >}}
Please use the starter template for your new site.
$ cd my-blog
$ hugo mod init github.com/me/my-blog$ hugo mod get github.com/razonyang/hugo-theme-bootstrap@[version]The [version] can be one of Releases, branches or even commits.
Replace
[version]withmasterfor getting latest changes.
- Clone the
hugo-theme-bootstrap-skeletonrepo 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/- Use node package manager
npmto pull in dependencies for this theme:
$ hugo mod npm pack
$ npm installStart hugo's built-in webserver, and then navigate to http://localhost:1313/.
$ hugo server