Skip to content

Commit d3cced8

Browse files
authored
Merge pull request #36026 from chalin/chalin-im-make-clear-dir-2022-08-16
Makefile: add --cleanDestinationDir flag to hugo cmd invocations
2 parents f3b23bf + 7de0371 commit d3cced8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ module-init: ## Initialize required submodules.
2929
all: build ## Build site with production settings and put deliverables in ./public
3030

3131
build: module-check ## Build site with non-production settings and put deliverables in ./public
32-
hugo --minify --environment development
32+
hugo --cleanDestinationDir --minify --environment development
3333

3434
build-preview: module-check ## Build site with drafts and future posts enabled
35-
hugo --buildDrafts --buildFuture --environment preview
35+
hugo --cleanDestinationDir --buildDrafts --buildFuture --environment preview
3636

3737
deploy-preview: ## Deploy preview site via netlify
38-
hugo --enableGitInfo --buildFuture --environment preview -b $(DEPLOY_PRIME_URL)
38+
hugo --cleanDestinationDir --enableGitInfo --buildFuture --environment preview -b $(DEPLOY_PRIME_URL)
3939

4040
functions-build:
4141
$(NETLIFY_FUNC) build functions-src
@@ -44,11 +44,11 @@ check-headers-file:
4444
scripts/check-headers-file.sh
4545

4646
production-build: module-check ## Build the production site and ensure that noindex headers aren't added
47-
hugo --minify --environment production
47+
hugo --cleanDestinationDir --minify --environment production
4848
HUGO_ENV=production $(MAKE) check-headers-file
4949

5050
non-production-build: module-check ## Build the non-production site, which adds noindex headers to prevent indexing
51-
hugo --enableGitInfo --environment nonprod
51+
hugo --cleanDestinationDir --enableGitInfo --environment nonprod
5252

5353
serve: module-check ## Boot the development server.
5454
hugo server --buildFuture --environment development

0 commit comments

Comments
 (0)