-
Notifications
You must be signed in to change notification settings - Fork 1
/
website.mak
28 lines (20 loc) · 871 Bytes
/
website.mak
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
#
# Makefile for running pandoc on all Markdown docs ending in .md
#
PROJECT = fdx
PANDOC = $(shell which pandoc)
MD_PAGES = $(shell ls -1 *.md | grep -v 'nav.md')
HTML_PAGES = $(shell ls -1 *.md | grep -v 'nav.md' | sed -E 's/.md/.html/g')
build: $(HTML_PAGES) $(MD_PAGES) pagefind
$(HTML_PAGES): $(MD_PAGES) .FORCE
if [ -f $(PANDOC) ]; then $(PANDOC) --metadata title=$(basename $@) -s --to html5 $(basename $@).md -o $(basename $@).html \
--lua-filter=links-to-html.lua \
--template=page.tmpl; git add $(basename $@).html; fi
@if [ $@ = "README.html" ]; then git mv README.html index.html; fi
pagefind: .FORCE
#pagefind --verbose --exclude-selectors="nav,header,footer" --bundle-dir ./pagefind --source .
pagefind --verbose --exclude-selectors="nav,header,footer" --site .
git add pagefind
clean:
@if [ -f index.html ]; then rm *.html; fi
.FORCE: