-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (35 loc) · 941 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# hugo -vvv --debug --logLevel debug --config config.toml,site-${input:hugoWebsite}.toml -b https://${input:hugoWebsite} -d dist/${input:hugoWebsite} --cleandestDir
# Configure environment
env ?= production
# Configure destination
dest ?= public
# Define default parameters
args := --destination=$(dest) --cleanDestinationDir
# Enable warnings
warn ?=
ifneq ($(strip $(warn)),)
args += --printI18nWarnings --printPathWarnings --printUnusedTemplates
endif
# Enable debugging
debug ?=
ifneq ($(strip $(debug)),)
args += --debug --logLevel=debug
endif
# Enable minification
minify ?=
ifneq ($(strip $(minify)),)
args += --minify
endif
# Define site-specific configuration
domain ?=
ifneq ($(strip $(domain)),)
args += --baseURL="https://$(domain)" --config=config/$(domain)/hugo.toml
endif
.PHONY: all
all: dev
.PHONY: build
build:
hugo --environment=$(env) $(args)
.PHONY: dev
dev:
hugo server --bind 0.0.0.0 -D -F -w $(args)