Skip to content

Commit 56e7094

Browse files
authored
Set Netlify build commands via netlify.toml (#214)
1 parent cbe5a23 commit 56e7094

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

netlify.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Hugo build configuration for Netlify
2+
# (https://gohugo.io/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify)
3+
14
[build]
5+
command = "npm build:preview"
6+
27
[build.environment]
38
GO_VERSION = "1.20.4"
9+
10+
[context.production]
11+
command = "npm build:production"

package.json

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,26 @@
88
"license": "Apache-2.0",
99
"bugs": "https://github.com/google/docsy-example/issues",
1010
"scripts": {
11-
"_serve:hugo": "hugo server -DFE --minify",
12-
"build": "hugo --cleanDestinationDir -e dev -DFE",
13-
"serve": "npm run _serve:hugo",
11+
"_build": "npm run _hugo-dev",
12+
"_check:links": "echo IMPLEMENTATION PENDING for check-links; echo",
13+
"_hugo": "hugo --cleanDestinationDir --themesDir ../..",
14+
"_hugo-dev": "npm run _hugo -- -e dev -DFE",
15+
"_serve": "npm run _hugo-dev -- --minify serve",
16+
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
17+
"build:production": "npm run _hugo -- --minify",
18+
"build": "npm run _build",
19+
"check:links:all": "HTMLTEST_ARGS= npm run _check:links",
20+
"check:links": "npm run _check:links",
21+
"clean": "rm -Rf public/* resources",
22+
"make:public": "git init -b main public",
23+
"precheck:links:all": "npm run build",
24+
"precheck:links": "npm run build",
25+
"postbuild:preview": "npm run _check:links",
26+
"postbuild:production": "npm run _check:links",
27+
"prepare": "cd .. && npm install",
28+
"serve": "npm run _serve",
29+
"test": "npm run check:links",
30+
"update:pkg:dep": "npm install --save-dev autoprefixer@latest postcss-cli@latest",
1431
"update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest"
1532
},
1633
"devDependencies": {

0 commit comments

Comments
 (0)