summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-05 14:26:47 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-05 14:26:47 +0200
commit46742271d7310c263e7b799401f0b769e1650d7c (patch)
tree07096304c38b312a79113ae58d3b34dcafbee90b
parent3d1a07ccc6637de659dfbfeb5258bb5f25d924c3 (diff)
downloadgohugo-theme-ed-46742271d7310c263e7b799401f0b769e1650d7c.tar.gz
Clean up netlify and npm config
-rw-r--r--netlify.toml37
-rw-r--r--package.json11
2 files changed, 27 insertions, 21 deletions
diff --git a/netlify.toml b/netlify.toml
index 382c755..279bca1 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,6 +1,20 @@
+# Settings in the [build] context are global and are applied to
+# all contexts unless otherwise overridden by more specific contexts.
[build]
+ # Directory that contains the deploy-ready HTML files and
+ # assets generated by the build. This is relative to the base
+ # directory if one has been set, or the root directory if
+ # a base has not been set. This sample publishes the directory
+ # located at the absolute path "root/project/build-output"
publish = 'public'
- command = 'npm run build:prod'
+
+# Production context: all deploys from the Production branch
+# set in your site’s Branches settings in the UI will inherit
+# these settings. You can define environment variables
+# here but we recommend using the Netlify UI for sensitive
+# values to keep them out of your source repository.
+[context.production]
+ command = 'hugo --enableGitInfo --source=exampleSite --destination ../public'
[context.production.environment]
HUGO_VERSION = '0.101.0'
@@ -8,26 +22,25 @@
HUGO_ENABLEGITINFO = 'true'
HUGO_GOOGLEANALYTICS = 'G-DP9Q137C3X'
-[context.split1]
- command = 'npm run build:split1'
-
-[context.split1.environment]
- HUGO_VERSION = '0.101.0'
- HUGO_ENV = 'production'
-
+# Deploy Preview context: all deploys generated from
+# a pull/merge request will inherit these settings.
[context.deploy-preview]
- command = 'npm run build:preview'
+ command = 'hugo --enableGitInfo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public'
[context.deploy-preview.environment]
HUGO_VERSION = '0.101.0'
+ HUGO_ENV = 'development'
+ HUGO_ENABLEGITINFO = 'true'
+# Branch Deploy context: all deploys that are not from
+# a pull/merge request or from the Production branch
+# will inherit these settings.
[context.branch-deploy]
- command = 'npm run build:branch'
+ command = 'hugo --enableGitInfo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public'
[context.branch-deploy.environment]
HUGO_VERSION = '0.101.0'
-
-[context.next.environment]
+ HUGO_ENV = 'development'
HUGO_ENABLEGITINFO = 'true'
# There are a basic set of standard security headers that every
diff --git a/package.json b/package.json
index 63ff9c5..f723998 100644
--- a/package.json
+++ b/package.json
@@ -20,13 +20,7 @@
"author": "Serghei Iakovlev",
"main": "index.js",
"scripts": {
- "clean": "rimraf public",
- "build": "npm install && hugo --source=exampleSite --gc --verbose --destination ../public",
- "build:prod": "npm install && hugo --source=exampleSite --destination ../public",
- "build:split1": "npm install && hugo --source=exampleSite --enableGitInfo --destination ../public",
- "build:preview": "npm install && HUGO_PREVIEW=true hugo --source=exampleSite --buildDrafts --buildFuture --baseURL $DEPLOY_PRIME_URL --destination ../public",
- "build:branch": "npm install && hugo --source=exampleSite --buildDrafts --buildFuture --baseURL $DEPLOY_PRIME_URL --destination ../public",
- "server": "HUGO_PREVIEW=true HUGO_ENV=development hugo server --verbose --source=exampleSite --buildDrafts --buildFuture --ignoreCache --disableFastRender",
+ "server": "HUGO_ENV=development hugo server --verbose --source=exampleSite --buildDrafts --buildFuture --ignoreCache --disableFastRender",
"lint": "npm run lint:js && npm run lint:editorconfig",
"lint:editorconfig": "editorconfig-checker",
"lint:js": "eslint static/js/*.js assets/js/*.js"
@@ -34,7 +28,6 @@
"dependencies": {},
"devDependencies": {
"editorconfig-checker": "^4.0.2",
- "eslint": "^8.19.0",
- "rimraf": "^3.0.2"
+ "eslint": "^8.19.0"
}
}