-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebsite.mak
28 lines (20 loc) · 901 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 = CMTools
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; fi
@if [ $@ = "README.html" ]; then mv README.html index.html; fi
pagefind: .FORCE
# NOTE: I am not including most of the archive in PageFind index since it doesn't make sense in this case.
pagefind --verbose --glob="{*.html,docs/*.html}" --force-language en-US --exclude-selectors="nav,header,footer" --output-path ./pagefind --site .
git add pagefind
clean:
@rm *.html
.FORCE: