1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00
seirdy.one/scripts/xhtmlize.sh
Rohan Kumar 90aeb2d23a
Create both index.html and index.xhtml files
Combines well with content-negotiation based on the "Accept" header.
2022-05-30 16:09:40 -07:00

12 lines
578 B
Bash

#!/bin/sh
# takes an arg for the output dir.
# copies every .html file to an equivalent .xhtml file.
# does the same for compressed html files.
# this means that every index.html file has an equivalent index.xhtml file.
# content negotiation allows an agent to pick html or xhtml.
# too lazy to DRY this shit
find "$1" -type f -name '*.html' -exec sh -c 'cp "$0" "${0%*.html}.xhtml"' {} \;
find "$1" -type f -name '*.html.gz' -exec sh -c 'cp "$0" "${0%*.html.gz}.xhtml.gz"' {} \;
find "$1" -type f -name '*.html.br' -exec sh -c 'cp "$0" "${0%*.html.br}.xhtml.br"' {} \;
# done