[gen.sh] compress css, easier to read output
This commit is contained in:
parent
34acda7f40
commit
debc7a9380
|
@ -1,2 +1,3 @@
|
||||||
format
|
format
|
||||||
site/*
|
site/*
|
||||||
|
resoureces/style.css
|
||||||
|
|
32
gen.sh
32
gen.sh
|
@ -1,25 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
gen_site_index() {
|
# Strip the CSS file of whitespace to reduce file size
|
||||||
indexfile=site/site-index.html
|
echo "Generating CSS"
|
||||||
|
tr -d " \t\n\r" < resources/style-formatted.css > resources/style.css
|
||||||
|
|
||||||
cat resources/header.html > $indexfile
|
# Generate HTML pages from Writan sources
|
||||||
|
echo "Generating pages"
|
||||||
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
|
|
||||||
for file in site-src/*; do
|
for file in site-src/*; do
|
||||||
bn=$(basename $file .wtn)
|
bn=$(basename $file .wtn)
|
||||||
echo "$file -> site/$bn.html"
|
echo " $file -> site/$bn.html"
|
||||||
./format $file site/$bn.html
|
./format $file site/$bn.html
|
||||||
done
|
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
|
||||||
|
|
Loading…
Reference in New Issue