reisnudel/process.sh
2026-03-24 22:13:08 +01:00

25 lines
587 B
Bash

# processes the html and stuff into the serve folder
find . | grep "[$]" && exit 1 # prevent XSS
process() {
# this can modify the contents of each html file,
# e.g. by adding a sed command. the file is piped
# through this function.
cat \
| sed -E 's/<<<(.*)>>>/<br><br><\1><br><br>/g'
}
# delete everything on the site rn
mkdir serve || rm -rf serve/*
# transfer directories
for file in $(find . -type d -not -path '*/.*') ; do
mkdir serve/"$file"
done
# transfer html
for file in $(find . | grep .html) ; do
cat header.html "$file" | process > serve/"$file"
done