paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2825a8a60dbb187b5bad8db713e5649b49d91c8e
parent 84a1327b6325fc745d6948d525c6a896c021105d
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue, 26 Mar 2019 23:25:11 -0400

Fix bug where createpages would build empty .html page

Diffstat:
Mcreatepages.sh | 24+++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/createpages.sh b/createpages.sh @@ -19,17 +19,19 @@ numpages=0 echo "Building $@..." for page in $@; do - pagename=$(basename $page | cut -f 1 -d '.') - echo "=====Creating $pagename.html=====" - echo " Compiling page content..." - markdown pages/$pagename.md > build/$pagename-content.html - echo " Constructing full page..." - > public/html/$pagename.html - cat build/header.html >> public/html/$pagename.html - cat build/$pagename-content.html >> public/html/$pagename.html - cat build/footer.html >> public/html/$pagename.html - ((numpages++)) - echo -e "=====Created $pagename.html=====\n" + if [[ "$pagename" != "" ]]; then + pagename=$(basename $page | cut -f 1 -d '.') + echo "=====Creating $pagename.html=====" + echo " Compiling page content..." + markdown pages/$pagename.md > build/$pagename-content.html + echo " Constructing full page..." + > public/html/$pagename.html + cat build/header.html >> public/html/$pagename.html + cat build/$pagename-content.html >> public/html/$pagename.html + cat build/footer.html >> public/html/$pagename.html + ((numpages++)) + echo -e "=====Created $pagename.html=====\n" + fi done if [[ $1 == '-i' ]]; then