1
1
HUGO_VERSION = $(shell grep ^HUGO_VERSION netlify.toml | tail -n 1 | cut -d '=' -f 2 | tr -d " \"\n")
2
2
NODE_BIN = node_modules/.bin
3
3
NETLIFY_FUNC = $(NODE_BIN ) /netlify-lambda
4
+ DEPLOY_PRIME_URL ?=/
4
5
5
6
# The CONTAINER_ENGINE variable is used for specifying the container engine. By default 'docker' is used
6
7
# but this can be overridden when calling make, e.g.
@@ -29,13 +30,13 @@ module-init: ## Initialize required submodules.
29
30
all : build # # Build site with production settings and put deliverables in ./public
30
31
31
32
build : module-check # # Build site with non-production settings and put deliverables in ./public
32
- hugo --minify --environment development
33
+ hugo --cleanDestinationDir -- minify --environment development
33
34
34
35
build-preview : module-check # # Build site with drafts and future posts enabled
35
- hugo --buildDrafts --buildFuture --environment preview
36
+ hugo --cleanDestinationDir -- buildDrafts --buildFuture --environment preview
36
37
37
38
deploy-preview : # # Deploy preview site via netlify
38
- hugo --enableGitInfo --buildFuture --environment preview -b $(DEPLOY_PRIME_URL )
39
+ hugo --cleanDestinationDir -- enableGitInfo --buildFuture --environment preview -b $(DEPLOY_PRIME_URL )
39
40
40
41
functions-build :
41
42
$(NETLIFY_FUNC ) build functions-src
@@ -44,11 +45,11 @@ check-headers-file:
44
45
scripts/check-headers-file.sh
45
46
46
47
production-build : module-check # # Build the production site and ensure that noindex headers aren't added
47
- hugo --minify --environment production
48
+ hugo --cleanDestinationDir -- minify --environment production
48
49
HUGO_ENV=production $(MAKE ) check-headers-file
49
50
50
51
non-production-build : module-check # # Build the non-production site, which adds noindex headers to prevent indexing
51
- hugo --enableGitInfo --environment nonprod
52
+ hugo --cleanDestinationDir -- enableGitInfo --environment nonprod
52
53
53
54
serve : module-check # # Boot the development server.
54
55
hugo server --buildFuture --environment development
0 commit comments