-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (67 loc) · 2.25 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.PHONY: release clean
DIST := dist
IMAGES := $(addprefix $(DIST)/static/images/, $(notdir $(wildcard images/*)))
VIDEOS := $(addprefix $(DIST)/static/videos/, $(notdir $(wildcard videos/*)))
DOCS := $(addprefix $(DIST)/static/docs/, $(notdir $(wildcard docs/*)))
VECTOR_IMAGES := $(addprefix $(DIST)/static/images/, $(notdir $(wildcard latex/*.svg)))
FONTS := $(addprefix $(DIST)/static/fonts/, $(notdir $(wildcard fonts/*)))
POST_SOURCES := $(wildcard nunjucks/posts/*.njk)
POST_TARGETS := $(addprefix $(DIST)/posts/, $(notdir $(POST_SOURCES:.njk=.html)))
MAIN_PAGE_SOURCES := $(wildcard nunjucks/*.njk)
MAIN_PAGE_TARGETS := $(addprefix $(DIST)/, $(notdir $(MAIN_PAGE_SOURCES:.njk=.html)))
VOCAB := $(addsuffix .njk, $(addprefix nunjucks/posts/_include/_inner-universe-vocabulary-, $(shell seq 1 8)))
release: $(DIST)/CNAME \
$(DIST)/favicon.ico \
$(IMAGES) \
$(VIDEOS) \
$(DOCS) \
$(VECTOR_IMAGES) \
$(FONTS) \
$(DIST)/static/css/main.css \
$(DIST)/static/js/mathjax.js \
$(DIST)/static/js/main.js \
$(DIST)/static/js/findAndReplaceDOMText.js \
$(MAIN_PAGE_TARGETS) \
$(POST_PAGE_TARGETS)
$(DIST)/CNAME: CNAME
@mkdir -p $(@D)
@cp $< $@
$(DIST)/favicon.ico: favicon/favicon.ico
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/images/%: images/%
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/images/%.svg: latex/%.svg
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/videos/%: videos/%
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/docs/%: docs/%
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/fonts/%: fonts/%
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/js/%: javascripts/%
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/js/findAndReplaceDOMText.js: node_modules/findandreplacedomtext/src/findAndReplaceDOMText.js
@mkdir -p $(@D)
@cp $< $@
$(DIST)/static/css/main.css: scss/main.scss
@mkdir -p $(@D)
@npx stylelint $<
@npx sass $< $@
nunjucks/posts/_include/_ipa-table.njk: data/phonetic-alphabets.json
@npx node preprocess/ipa-table.mjs
nunjucks/posts/_include/_abbreviations.njk: data/abbreviations.json
@npx node preprocess/abbreviation.mjs
$(VOCAB): data/inner-universe.json
@npx node preprocess/abbreviation.mjs
nunjucks/posts/inner-universe.njk: $(VOCAB)
$(MAIN_PAGE_TARGETS) $(POST_TARGETS): $(MAIN_PAGE_SOURCES) $(POST_SOURCES)
@npx @11ty/eleventy > /dev/null
clean:
@rm -rf $(DIST)