summaryrefslogtreecommitdiff
path: root/makefile
blob: 0d89862df03e6c3d5bb1dab9a82bcb4c04ffdbda (plain) (blame)
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
62
63
MD = $(shell find md/ -type f -name '*.md')
CSS = $(shell find md/ -type f -name '*.css')
JPG = $(shell find md/ -type f -name '*.jpg')
PNG = $(shell find md/ -type f -name '*.png')

CSS_OUT = $(patsubst md/%.css, html/%.css, $(CSS))
JPG_OUT = $(patsubst md/%.jpg, html/%.jpg, $(JPG))
PNG_OUT = $(patsubst md/%.png, html/%.png, $(PNG))

53HORNET_OUT = $(patsubst md/53hor.net/%.md, html/53hor.net/%.html, $(MD))
ATC_OUT = $(patsubst md/atc.53hor.net/%.md, html/atc.53hor.net/%.html, $(MD))
WED_OUT = $(patsubst md/wedding/%.md, html/wedding/%.html, $(MD))

.PHONY: all
all: css img 53hor.net atc.53hor.net wedding

.PHONY: css
css: $(CSS_OUT)

html/%.css: md/%.css
	@echo "css: $< -> $@"
	@mkdir -p "$(@D)"
	@cp "$<" "$@"

.PHONY: img
img: $(JPG_OUT) $(PNG_OUT)

html/%.jpg: md/%.jpg
	@echo "img: $< -> $@"
	@mkdir -p "$(@D)"
	@convert "$<" -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB -resize 1000x1000\> "$@"

html/%.png: md/%.png
	@echo "img: $< -> $@"
	@mkdir -p "$(@D)"
	@convert "$<" -strip -quality 90 -resize 1000x1000\> "$@"

.PHONY: 53hor.net
53hor.net: $(53HORNET_OUT)

html/53hor.net/%.html: md/53hor.net/%.md md/53hor.net/nav.html
	@echo   "53hor.net: $< -> $@"
	@mkdir -p "$(@D)"
	@pandoc "$<" -f markdown -t html5 -s --toc --toc-depth=2 -H md/53hor.net/background.html -B md/53hor.net/nav.html -c /styles.css -o "$@"

.PHONY: atc.53hor.net
atc.53hor.net: $(ATC_OUT)

html/atc.53hor.net/%.html: md/atc.53hor.net/%.md md/atc.53hor.net/nav.html
	@echo "atc.53hor.net: $< -> $@"
	@mkdir -p "$(@D)"
	@pandoc "$<" -f markdown -t html5 -s --toc --toc-depth=3 -B md/atc.53hor.net/nav.html -c /styles.css -o "$@"

.PHONY: wedding
wedding: $(WED_OUT)

html/wedding/%.html: md/wedding/%.md md/wedding/nav.html
	@echo "wedding: $< -> $@"
	@mkdir -p "$(@D)"
	@pandoc "$<" -f markdown -t html5 -s -H md/wedding/background.html -B md/wedding/nav.html -c /styles.css -o "$@"

clean:
	@rm -rf html/