-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebsite.mak
24 lines (17 loc) · 835 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
#
# Makefile for running pandoc on all Markdown docs ending in .md
#
PROJECT = scripttool
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
pandoc --metadata title=$(basename $@) -s --to html5 $(basename $@).md -o $(basename $@).html --lua-filter=links-to-html.lua --template=page.tmpl
@if [ "$(basename $@)" = "README" ]; then mv README.html index.html; git add index.html; else git add "$(basename $@).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: