This article explains how to upgrade the theme correctly.

Versions#

Before upgrading, it is necessary to introduce what a version is. In addition to the relative stable versions listed in Releases, you can use a branch such as master, develop, or even choose a certain commit.

This article will use the [version] placeholder to represent the version, just replace it with the version you want to install.

Upgrade#

Please choose the upgrade step depending on the installation method: Git Submodule and Hugo Module.

Note that no matter which install method you use, you will always end up needing to pull and install dependencies via hugo mod npm pack and npm install.

Git Submodule#

$ cd themes/hugo-theme-bootstrap
$ git fetch
$ git checkout [version]
$ cd ../../
$ hugo mod npm pack
$ npm update
$ git add themes/hugo-theme-bootstrap package.json package-lock.json
$ git commit -m 'Bump theme to [version]'
  • git fetch pull the latest branch and tag information form the theme repository.
  • git checkout [version] switch to the [version] version.
  • hugo mod npm pack and npm install to pull and install the latest dependencies form the theme.

Hugo Module#

$ hugo mod get github.com/razonyang/hugo-theme-bootstrap@[version]
$ hugo mod tidy
$ hugo mod npm pack
$ npm update
$ git add go.mod go.sum package.json package-lock.json
$ git commit -m 'Bump theme to [version]'
  • hugo mod tidy clean up any redundant dependencies.
  • hugo mod npm pack and npm install pull and install the latest dependencies form the theme.