Hosting Hugo in Netlify
You need to add in root directory netfily.toml
.
1[build]
2publish = "public"
3command = "hugo --gc --minify"
4
5[context.production.environment]
6HUGO_VERSION = "0.74.3"
7HUGO_ENV = "production"
8HUGO_ENABLEGITINFO = "true"
9
10[context.split1]
11command = "hugo --gc --minify --enableGitInfo"
12
13[context.split1.environment]
14HUGO_VERSION = "0.74.3"
15HUGO_ENV = "production"
16
17[context.deploy-preview]
18command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
19
20[context.deploy-preview.environment]
21HUGO_VERSION = "0.74.3"
22
23[context.branch-deploy]
24command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
25
26[context.branch-deploy.environment]
27HUGO_VERSION = "0.74.3"
28
29[context.next.environment]
30HUGO_ENABLEGITINFO = "true"
See details in https://gohugo.io/hosting-and-deployment/hosting-on-netlify/