diff --git a/website/Makefile b/website/Makefile index e661ea0abb55e..a65beb151b3f2 100644 --- a/website/Makefile +++ b/website/Makefile @@ -1,5 +1,10 @@ CUE = ./scripts/cue.sh +# Override to specify which network address to use in Hugo/HTTP servers for binding +export SERVER_BIND ?= 127.0.0.1 +# Override to specify which port to use in Hugo/HTTP servers for listening +export SERVER_PORT ?= 1313 + clean: rm -rf public resources data/docs.json @@ -33,6 +38,8 @@ structured-data: cue-build config-examples serve: clean setup structured-data hugo server \ + --bind $(SERVER_BIND) \ + --port $(SERVER_PORT) \ --buildDrafts \ --buildFuture \ --environment "development" @@ -48,7 +55,7 @@ ci-production-build: setup structured-data production-build run-link-checker alg # Preview site preview-build: hugo \ - --baseURL $(DEPLOY_PRIME_URL) \ + $(if $(DEPLOY_PRIME_URL),--baseURL $(DEPLOY_PRIME_URL),) \ --buildFuture \ --environment "preview" \ --minify @@ -74,7 +81,7 @@ algolia: # Useful for locally debugging issues that arise only on the deployed production site run-production-site-locally: make setup structured-data production-build - python3 -m http.server 1313 --directory ./public --bind 127.0.0.1 + python3 -m http.server $(SERVER_PORT) --bind $(SERVER_BIND) --directory ./public # Local dev build with no link checking and no Yarn dependency fetching quick-build: clean structured-data production-build