www-bocal/legacy-rewrite-attempt/compile.sh
2017-09-21 09:45:35 +02:00

13 lines
385 B
Bash
Executable file

#!/bin/bash
mv $1.html $1.html.backup
name=$(head -n 1 $1.htm)
if [[ $name == '' ]]
then
name=$(cat ./includes/header.html | grep -Po '\${title "\K[^"]*')
fi
header=$(cat ./includes/header.html | sed "s/\${title[^}]*}/$name/")
echo "$header" > $1.html
echo "`cat ./includes/menu.html`" >> $1.html
echo "`tail -n +2 $1.htm`" >> $1.html
echo "`cat ./includes/footer.html`" >> $1.html