+++
title = "Upgradation" date = 2022-06-25T22:15:02+08:00
featured = false draft = false comment = true toc = true reward = true pinned = false carousel = false categories = [] tags = [] series = ["Docs"] images = [] authors = ["RazonYang"] +++
This article explains how to upgrade the theme correctly.
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 upgrade to.
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 update dependencies via
hugo mod npm pack
andnpm update
.
If you intend to add additional dependencies, you need to define it in package.hugo.json
instead of package.json
.
That's because the hugo mod npm pack
will always override the package.json
, which merges theme's package.hugo.json
and your site's package.hugo.json
.
{{% code/upgradation-git-submodule %}}
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
andnpm update
to pull and update the latest dependencies form the theme.
{{% code/upgradation-hugo-module %}}
hugo mod tidy
clean up any redundant dependencies.hugo mod npm pack
andnpm update
pull and update the latest dependencies form the theme.