2022-05-30 16:09:40 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# takes an arg for the output dir.
|
2022-05-31 17:16:44 -07:00
|
|
|
# copies every .html file to an equivalent .xhtml file, but replaces
|
|
|
|
# the meta charset with an XML declaration for compatibility with some
|
|
|
|
# XML tooling.
|
2022-05-30 16:09:40 -07:00
|
|
|
# this means that every index.html file has an equivalent index.xhtml file.
|
|
|
|
# content negotiation allows an agent to pick html or xhtml.
|
|
|
|
|
2022-05-31 17:16:44 -07:00
|
|
|
find "$1" -type f -name '*.html' \
|
|
|
|
-exec sh -c 'echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | cat - "$0" | grep -Fv "<meta charset=\"UTF-8\" />" >"${0%*.html}.xhtml"' {} \;
|
2022-05-30 16:09:40 -07:00
|
|
|
# done
|