blob: 0ef4c0e86be7728870d5dd8ea5d6852402bdb9c6 (
plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#!/bin/sh
usage() {
echo "$0: usage: $0 <destdir> [<srcdir>]" >&2
}
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
usage
return 1
fi
dst=$1
src=${2:-.}
echo "building at $(date)"
# build page
bp() {
echo "${src}/$1 ==> ${dst}/$2"
lua "${src}/$1" >"${dst}/$2"
}
# build page with extensions automatically
bpn() { bp ${1}.lua ${1}.html; }
# copy file (or dir)
cf() {
echo "${src}/$1 -> ${dst}/$1"
cp -r "${src}/$1" "${dst}/$1"
}
# mkdir
md () {
mkdir -p "${dst}/$1"
}
bpn index
cf bg.png
cf me.png
md questions
bpn questions/questions
# md blog
# bp blogindex.lua blog/index.html
# for p in blog/*; do
# bpn ${p%.lua}
# done
cf 4d.html
|