From 46742271d7310c263e7b799401f0b769e1650d7c Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Tue, 5 Jul 2022 14:26:47 +0200 Subject: Clean up netlify and npm config --- netlify.toml | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'netlify.toml') 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 -- cgit v1.2.3