b9fe0596f14a4d5700987cdce138d688093007ae
[nepi.git] / website / Makefile
1 ########## contents
2 ALL_MDS = $(shell git ls-files | grep '\.md$$')
3 PUBLISH_PATH = /var/www/html
4
5 #ALL_PLUGINS = plugins/*.{js,css,html}
6
7 ########## default target
8 all: preview
9
10 preview: prepare index meta convert 
11 # this is what is invoked by restart-website.sh that is crontab'ed
12 install: preview publish
13
14 .PHONY: all preview publish install prepare index meta convert 
15 preview_and_nepiall: prepare index meta nepi_all convert 
16 install_and_nepiall: preview_and_nepiall publish
17
18 .PHONY: preview_and_nepiall install_and_nepiall
19
20 ########## global vars
21 # I am using the custom-made 'nepi' layout
22 # which was 'exported' (copied) from markdown-styles' 'bootstrap3' 
23
24 LAYOUT = ./nepi-layout
25
26 ##########
27 prepare:
28         @[ -d markdown ] || mkdir markdown
29         rsync -av --delete --relative $(ALL_MDS) markdown
30
31 # index.py is hard-wired to output in markdown/
32 index:
33         @[ -d markdown ] || mkdir markdown
34         export LC_ALL=en_US.UTF-8; ./index.py $(ALL_MDS)
35
36 # likewise
37 meta:
38         @[ -d markdown ] || mkdir markdown
39         ./meta.py
40
41 ################################
42
43 # compile status informations  by Nepi check
44 status:
45         @[ -d markdown ] || mkdir markdown
46         ./status.py
47
48 convert: 
49         generate-md --layout $(LAYOUT) --input markdown --output html
50
51 # default is ti publish locally as this runs right from r2lab.inria.fr
52 publish:
53         rsync -av --delete html/ $(PUBLISH_PATH)/
54
55 debug:
56         echo ALL_MDS=$(ALL_MDS)
57
58 clean:
59         rm -rf markdown html
60