mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-27 10:52:09 +00:00
866ca1b386
Allows better filtering and doesn't supress exit codes. Since I'm no longer supressing exit codes, I had to handle them properly in copy-file-to-xhtml.sh by using if-statements. This also allowed me to skip the generation of an XHTML redirect page.
17 lines
418 B
Bash
17 lines
418 B
Bash
#!/bin/sh
|
|
# Take a single polygot (X)HTML file and make a .xhtml copy of it. Do
|
|
# the same for static-compressed versions.
|
|
|
|
# no pipefail here since there are no pipes.
|
|
set -e -u
|
|
|
|
html_file="$1"
|
|
xhtml_file="${html_file%*.html}.xhtml"
|
|
|
|
cp -p "$html_file" "$xhtml_file"
|
|
if [ -f "$html_file.gz" ]; then
|
|
cp -p "$html_file.gz" "$xhtml_file.gz"
|
|
fi
|
|
if [ -f "$html_file.br" ]; then
|
|
cp -p "$html_file.br" "$xhtml_file.br"
|
|
fi
|