forked from pythonindia/inpycon-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (47 loc) · 1.9 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
57
58
59
60
61
PELICAN?=pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PLUGIN_REQUIREMENTS=$(wildcard plugins/*/requirements.txt)
PORT ?= 8000
BIND ?= 127.0.0.1
DEBUG ?= False
ifeq ($(DEBUG), True)
PELICANOPTS += -D
endif
GENERATOR=$(PELICAN) $(INPUTDIR) --output $(OUTPUTDIR) --settings $(CONFFILE) $(PELICANOPTS)
SITEURL?="https://in.pycon.org/blog"
FEED_ALL_ATOM?="feeds/all.atom.xml"
CATEGORY_FEED_ATOM?="feeds/%s.atom.xml"
PUBLISHENV=SITEURL=$(SITEURL) FEED_ALL_ATOM=$(FEED_ALL_ATOM) CATEGORY_FEED_ATOM=$(CATEGORY_FEED_ATOM)
help:
@echo 'Makefile for a pelican Web site '
@echo ' '
@echo 'Usage: '
@echo ' make html [PUBLISH=False] (re)generate the web site '
@echo ' make clean remove the generated files '
@echo ' make serve [PORT=8000] serve site at http://localhost:8000 '
@echo ' '
@echo 'Set DEBUG to True to enable debugging, e.g. make html DEBUG=True '
@echo 'Set PUBLISH to True in `make html` to publish, e.g. make html PUBLISH=True '
@echo ' '
requirements:
pip install -r requirements.txt
for requirement in $(PLUGIN_REQUIREMENTS); do \
pip install -r $$requirement; \
done
html: $(INPUTDIR) $(CONFFILE) $(OUTPUTDIR)
$(OUTPUTDIR):
ifeq ($(PUBLISH), True)
$(PUBLISHENV) $(GENERATOR)
else
$(GENERATOR)
endif
build: requirements html
clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
serve:
$(PELICAN) --listen --autoreload $(INPUTDIR) --settings $(CONFFILE) --port $(PORT) --bind $(BIND) $(PELICANOPTS)
.PHONY: html help clean serve