summaryrefslogtreecommitdiffstats
path: root/build.sh
blob: bd3b5bc704429fc46e3537c6b27ca22097cdf1f7 (plain) (blame)
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
#!/bin/sh

[ ! -d dist ] && mkdir dist

rm -f dist/*

cp ./*.css ./*.svg ./*.png ./*.jpg dist/

awk -f lib/inc.awk ./*.html

for file in ./*.html; do
	if [ "$file" = "index.html" ] ||
		[ ! -f "${file%%.html}-inc.htm" ]; then
		cp "$file" dist/
		continue
	fi
	ed "$file" <<EOF
?<\/body>?-r footer.htm
?{{incoming}}?d
-r ${file%%.html}-inc.htm
w dist/$file
q
EOF
done

rm ./*-inc.htm