-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (33 loc) · 806 Bytes
/
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
OUTPUT_DIR := docs
SRC_DIR := site
SOURCES := $(wildcard $(shell find $(SRC_DIR) -name "*.md"))
STYLES := $(wildcard css/*.css)
TARGETS := $(patsubst $(SRC_DIR)%, $(OUTPUT_DIR)%, $(SOURCES:.md=.html))
.PHONY: all
all: posts $(TARGETS)
# Debugging target
debug:
$(info SOURCES: $(SOURCES))
$(info TARGETS: $(TARGETS))
## Generalized rule: how to build a .html file from each .md
$(OUTPUT_DIR)/%.html: $(SRC_DIR)/%.md
mkdir -p $(@D)
pandoc \
--katex \
--section-divs \
--from markdown+tex_math_single_backslash \
--filter pandoc-sidenote \
--highlight-style breezedark \
--to html5+smart \
--template=tufte \
$(foreach style,$(STYLES),--css $(style)) \
-s \
--embed-resource \
--output $@ \
$<
.PHONY: clean
clean:
rm -f $(TARGETS)
.PHONY: posts
posts:
./make-posts.sh