-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (29 loc) · 919 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
# Settings
MAKEFILES=Makefile $(wildcard *.mk)
UID=$(shell id -u)
GID=$(shell id -g)
# Controls
.PHONY : commands clean stop serve
.NOTPARALLEL:
all : commands
## commands : show all commands.
commands :
@grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
## build : build files but do not run a server.
build :
docker compose build --pull
## serve : start and run a local server.
serve : build
docker compose up -d
@echo "\nhot-reloading site up at http://localhost:1313, \"make stop\" to stop the server.\n"
## shell : open a hugo shell
shell : build
docker compose run --rm --user="${UID}:${GID}" hugo shell
## stop : stop the docker server and clean up
stop :
docker compose down -v
## clean : clean up junk files.
clean :
@rm -rf ./resources/_gen
@find . -name .DS_Store -print -exec rm {} \;
@find . -name '*~' -print -exec rm {} \;