You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -28,28 +28,30 @@ module-init:
28
28
29
29
all: build ## Build site with production settings and put deliverables in ./public
30
30
31
-
build: module-check ## Build site with production settings and put deliverables in ./public
32
-
hugo --minify
31
+
build: module-check ## Build site with non-production settings and put deliverables in ./public
32
+
hugo --minify --environment development
33
33
34
34
build-preview: module-check ## Build site with drafts and future posts enabled
35
-
hugo --buildDrafts --buildFuture
35
+
hugo --buildDrafts --buildFuture --environment preview
36
36
37
37
deploy-preview: ## Deploy preview site via netlify
38
-
hugo --enableGitInfo --buildFuture -b $(DEPLOY_PRIME_URL)
38
+
hugo --enableGitInfo --buildFuture --environment preview -b $(DEPLOY_PRIME_URL)
39
39
40
40
functions-build:
41
41
$(NETLIFY_FUNC) build functions-src
42
42
43
43
check-headers-file:
44
44
scripts/check-headers-file.sh
45
45
46
-
production-build: build check-headers-file ## Build the production site and ensure that noindex headers aren't added
46
+
production-build: module-check ## Build the production site and ensure that noindex headers aren't added
47
+
hugo --minify --environment production
48
+
HUGO_ENV=production $(MAKE) check-headers-file
47
49
48
-
non-production-build: ## Build the non-production site, which adds noindex headers to prevent indexing
49
-
hugo --enableGitInfo
50
+
non-production-build: module-check ## Build the non-production site, which adds noindex headers to prevent indexing
51
+
hugo --enableGitInfo --environment nonprod
50
52
51
53
serve: module-check ## Boot the development server.
52
-
hugo server --buildFuture
54
+
hugo server --buildFuture --environment development
53
55
54
56
docker-image:
55
57
@echo -e "$(CCRED)**** The use of docker-image is deprecated. Use container-image instead. ****$(CCEND)"
@@ -70,10 +72,10 @@ container-image: ## Build a container image for the preview of the website
70
72
--build-arg HUGO_VERSION=$(HUGO_VERSION)
71
73
72
74
container-build: module-check
73
-
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify"
75
+
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify --environment development"
74
76
75
77
container-serve: module-check ## Boot the development server using container. Run `make container-image` before this.
76
-
$(CONTAINER_RUN) --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
78
+
$(CONTAINER_RUN) --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
0 commit comments