In this section, we are going to talk about the key points of deployments to avoid most problems during deployment.
As Prerequisites mentioned, you’ll need to set up those tools on your deployment environment.
We use NPM for managing the theme’s dependencies, it’s necessary to install the dependencies on deployment environment, since we SHOULD NOT commit the
1$ npm i
npm iis the shortcut of
package-lock.jsonMUST be committed, npm relies on the former, the later will save the installation time.
It’s time to build the site after installing the dependencies.
1$ hugo --gc --minify
--minifyminify the final HTML.
You can change the
The command generated the site and save it under the
public directory by default.
This step depends on the which deployment methods you use.