From 9f3f9ec75842ea4f6758a9bd0aa5c68f7aa41a65 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Thu, 26 Nov 2020 13:48:04 +0000 Subject: [PATCH] Fix the baseURL for dev and prod use caes The baseURL is not set for dev and prod which causes the following issues: - for dev, the URL shown on the console is not the correct one - for prod, the generated sitemap.xml uses relative URLs, which makes it not parsable by the search engine This is already setup correctly for deploy-previews. Signed-off-by: Andrea Frittoli --- Makefile | 3 ++- netlify.toml | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 914d79d..a234794 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ sync: .PHONY: serve serve: hugo server \ + --baseURL $(URL) \ --buildDrafts \ --buildFuture \ --disableFastRender \ @@ -13,7 +14,7 @@ serve: .PHONY: production-build production-build: sync - hugo + hugo --baseURL $(URL) .PHONY: preview-build preview-build: sync diff --git a/netlify.toml b/netlify.toml index 4aadd3b..831a73f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,12 +1,15 @@ [build] -publish = "public" -command = "make production-build" + publish = "public" + command = "make production-build" [build.environment] -HUGO_VERSION = "0.53" + HUGO_VERSION = "0.53" + +[dev] + command = "make serve URL=http://localhost:8888/" [context.deploy-preview] -command = "make preview-build" + command = "make preview-build" [context.branch-deploy] -command = "make preview-build" + command = "make preview-build" -- GitLab