build.sh (view raw)
1#!/bin/sh
2
3[ ! -d dist ] && mkdir dist
4
5rm -f dist/*
6
7cp ./*.css ./*.svg ./*.png ./*.jpg dist/
8
9awk -f lib/inc.awk ./*.html
10
11for file in ./*.html; do
12 if [ "$file" = "index.html" ] ||
13 [ ! -f "${file%%.html}-inc.htm" ]; then
14 cp "$file" dist/
15 continue
16 fi
17 ed "$file" <<EOF
18?<\/body>?-r footer.htm
19?{{incoming}}?d
20-r ${file%%.html}-inc.htm
21w dist/$file
22q
23EOF
24done
25
26rm ./*-inc.htm