mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
114e2d88ee
- make xhtmlize exit early if any file fails to be xhtml-ized - add whitespace before self-closing slash.
19 lines
490 B
Bash
19 lines
490 B
Bash
#!/bin/sh
|
|
# takes an arg for the output dir.
|
|
# Runs xhtmlize-single-file.sh on every single html file in the output dir.
|
|
# exits if xhtmlize-single-file fails.
|
|
|
|
set -e -u
|
|
|
|
output_dir="$1"
|
|
script_dir="$(dirname "$0")"
|
|
|
|
printf '\t<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
|
|
cleanup() {
|
|
rm -f "tmp.css"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
export XMLLINT_INDENT=' '
|
|
time -p find "$output_dir" -type f -name '*.html' | xargs -n1 sh "$script_dir/xhtmlize-single-file.sh"
|
|
# done
|