codex/gen.sh

27 lines
730 B
Bash
Executable File

#!/bin/sh
# Strip the CSS file of whitespace to reduce file size
echo "Generating CSS"
sed "s/FG/#ddd/g" < resources/style-formatted.css |
sed "s/NORMALBG/#111/g" |
sed "s/CODEBG/#1a1a1a/g" |
tr -d " \t\n\r" > resources/style.css
# Generate HTML pages from Writan sources
echo "Generating pages"
for file in site-src/*; do
bn=$(basename $file .wtn)
echo " $file -> site/$bn.html"
./format $file site/$bn.html
done
# Generate the site index
indexfile=site/site-index.html
cat resources/header.html > $indexfile
echo "Generating full site index"
for file in site/*; do
bn=$(basename $file .html)
echo "<p><a href=\"$bn.html\">{$bn}</a>" >> $indexfile
done
cat resources/footer.html >> $indexfile