From debc7a9380312425716e914167b0389093cc297e Mon Sep 17 00:00:00 2001 From: opfez Date: Sat, 21 Aug 2021 13:25:15 +0200 Subject: [PATCH] [gen.sh] compress css, easier to read output --- .gitignore | 3 +- gen.sh | 32 +++++++++----------- resources/{style.css => style-formatted.css} | 0 3 files changed, 17 insertions(+), 18 deletions(-) rename resources/{style.css => style-formatted.css} (100%) diff --git a/.gitignore b/.gitignore index 14007fb..e35217d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ format -site/* \ No newline at end of file +site/* +resoureces/style.css diff --git a/gen.sh b/gen.sh index 454f3b0..14badf2 100755 --- a/gen.sh +++ b/gen.sh @@ -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 "

{$bn}" >> $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 "

{$bn}" >> $indexfile +done +cat resources/footer.html >> $indexfile diff --git a/resources/style.css b/resources/style-formatted.css similarity index 100% rename from resources/style.css rename to resources/style-formatted.css