-
Notifications
You must be signed in to change notification settings - Fork 358
/
Makefile
50 lines (38 loc) · 1.44 KB
/
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
47
48
49
50
HUGO_VERSION := v0.101.0
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: server
server: ## Runs Hugo locally `hugo server`
@hugo version | grep -q $(HUGO_VERSION) || echo "Your Hugo version does not match the recommended Hugo version $(HUGO_VERSION). If you are having problems make sure to align your version."
@hugo server
.PHONY: generate
generate: ## Let's hugo generate the site into the configured directory
# Generating locally, since in container an error is thrown
@hugo -d public
.PHONY: compose-up
compose-up: ## Runs Hugo in container in background via Docker Compose
docker compose up -d server
.PHONY: compose-down
compose-down: ## Stops Hugo container
docker compose down
.PHONY: compose-restart
compose-restart: ## Restarts Hugo container
docker compose restart server
.PHONY: compose-stop
compose-stop: ## Stops Hugo container
docker compose stop server
.PHONY: compose-logs
compose-logs: ## Display logs from Hugo container
docker compose logs -f server
.PHONY: spellcheck
spellcheck: ## Runs spell checker using Docker Compose in foreground
docker compose up spellchecker
.PHONY: linkcheck
linkcheck: generate ## Runs spell checker using Docker Compose in foreground
docker compose run linkchecker
.PHONY: clean
clean: ## Deletes temporary/generated files
rm -rf public
rm -rf resources