From f0884e0a4055456c7701b3a18ceca808d74c4596 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 21 Apr 2023 16:43:28 +0800 Subject: [PATCH] Fix Netlify settings for separate deployments --- Makefile | 4 ++++ netlify.toml | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d1b5667..7a50e74 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,10 @@ build: hugo --destination public +.PHONY: build-draft +build-draft: + hugo --environment development --buildDrafts --buildFuture --buildExpired --destination public + .PHONY: build-openring build-openring: ./bin/openring-create --input assets/templates/openring-input.html --output layouts/partials/openring.html diff --git a/netlify.toml b/netlify.toml index 03a2586..7fb101f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,15 +1,14 @@ [build] publish = "public/" -command = "make build" +command = "make build -e" [context.production.environment] -HUGO_BASE_URL = "$DEPLOY_URL" +HUGO_BASEURL = "$DEPLOY_URL" -[context.branch-deploy.environment] -HUGO_BASE_URL = "$DEPLOY_PRIME_URL" +[context.branch-deploy] +command = "make build-draft -e" +environment.HUGO_BASEURL = "$DEPLOY_PRIME_URL" [context.deploy-preview] -command = "hugo --buildDrafts --buildFuture --buildExpired" - -[context.deploy-preview.environment] -HUGO_BASE_URL = "$DEPLOY_PRIME_URL" +command = "make build-draft -e" +environment.HUGO_BASEURL = "$DEPLOY_PRIME_URL"