-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 2.1 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
51
52
53
54
55
56
PY?=
PELICAN?=pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
PUBLISHDIR=$(BASEDIR)/docs
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
CNAME=noelmiller.dev
DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
help:
@echo 'Makefile for a pelican Web site and podman commands '
@echo ' '
@echo 'Usage (Outside the Container): '
@echo ' make build builds a dev container '
@echo ' make clean remove the generated files '
@echo ' make post create post using container '
@echo ' make run runs a dev container '
@echo ' '
@echo 'Usage (Inside the Container): '
@echo ' make create-post creates a new post using template '
@echo ' make devserver [PORT=8000] serve and regenerate together '
@echo ' make publish-docs generate using production settings '
@echo ' '
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
@echo ' '
build:
podman build -t pelican:latest .
clean:
[ ! -d "$(OUTPUTDIR)" ] || rm -rf "$(OUTPUTDIR)"
post:
podman run --rm -it --volume .:/app:Z -p 8000:8000 pelican:latest create-post
run:
podman run --rm -it --volume .:/app:Z -p 8000:8000 pelican:latest devserver
create-post:
python create_post.py
devserver:
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
echo $(CNAME) > "$(OUTPUTDIR)/CNAME"
.PHONY: build clean post publish run create-post devserver publish-docs