30 lines
608 B
Bash
Executable File
30 lines
608 B
Bash
Executable File
#!/bin/sh -e
|
|
export PATH="$(dirname $(realpath $0)):$PATH"
|
|
|
|
usage() {
|
|
>&2 printf "usage: %s url [path]\\n" "$(basename "$0")"
|
|
exit 1
|
|
}
|
|
|
|
test $# -lt 1 && usage
|
|
|
|
export SRC="$(realpath src)"
|
|
export SHARE="$(realpath share)"
|
|
export OUT="$(realpath public)"
|
|
|
|
if ! test -f "${SRC}"/index.upphtml
|
|
then
|
|
>&2 printf "no index.upphtml file found\\n"
|
|
exit 1
|
|
fi
|
|
|
|
for t in "${SRC}"/*.upphtml
|
|
do
|
|
echo "Making $(basename "${t%.upphtml}".html)"
|
|
pp "${SHARE}"/l.upphtml "${t}" "$1" > \
|
|
"${OUT}/$(basename "${t%.upphtml}".html)"
|
|
done
|
|
|
|
echo "Making sitemap.xml"
|
|
pp "${SHARE}"/sitemap.uppxml "$1" > "${OUT}"/sitemap.xml
|