From 628b3c2249db280ecb60ec0f8fd8053f88a265e4 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Fri, 27 Sep 2024 20:23:26 +0200 Subject: Add Google Tag Manager support (#178) --- netlify.toml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'netlify.toml') diff --git a/netlify.toml b/netlify.toml index b7de027..bd57110 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,6 +7,7 @@ # a base has not been set. This sample publishes the directory # located at the absolute path "root/project/build-output" publish = 'public' + command = 'npm install' [build.environment] HUGO_VERSION = '0.121.0' @@ -15,22 +16,24 @@ # 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 +# here, but we recommend using the Netlify UI for sensitive # values to keep them out of your source repository. [context.production] command = 'hugo --source=exampleSite --baseURL ${URL} --destination ../public --minify' [context.production.environment] HUGO_ENV = 'production' - HUGO_GOOGLEANALYTICS = 'G-DP9Q137C3X' + HUGO_ENABLEGITINFO = 'true' # Deploy Preview context: all deploys generated from # a pull/merge request will inherit these settings. [context.deploy-preview] - command = 'npm run netlify-preview; hugo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public --minify' + # command = 'npm run netlify-preview; hugo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public --minify' + command = 'npm run netlify-production; npm run netlify-preview; hugo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public; cat ./public/index.html' [context.deploy-preview.environment] - HUGO_ENV = 'development' + # HUGO_ENV = 'development' + HUGO_ENV = 'production' # Branch Deploy context: all deploys that are not from # a pull/merge request or from the Production branch -- cgit v1.2.3