[gen.sh] compress css, easier to read output

This commit is contained in:
opfez 2021-08-21 13:25:15 +02:00
parent 34acda7f40
commit debc7a9380
3 changed files with 17 additions and 18 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
format
site/*
site/*
resoureces/style.css

32
gen.sh
View File

@ -1,25 +1,23 @@
#!/bin/sh
gen_site_index() {
indexfile=site/site-index.html
# Strip the CSS file of whitespace to reduce file size
echo "Generating CSS"
tr -d " \t\n\r" < resources/style-formatted.css > resources/style.css
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
}
# Generating html pages from writan sources
# Generate HTML pages from Writan sources
echo "Generating pages"
for file in site-src/*; do
bn=$(basename $file .wtn)
echo "$file -> site/$bn.html"
echo " $file -> site/$bn.html"
./format $file site/$bn.html
done
gen_site_index
# 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