diff --git a/build.sh b/build.sh index 7240b38..c9055c8 100755 --- a/build.sh +++ b/build.sh @@ -73,7 +73,6 @@ html_start() echo "" >> "$1" # DC ignores this, but need this to look consistent on other browsers pagedump "./sites/$3/header" >> "$1" - echo "
" >> "$1" echo "" >> "$1" echo "" >> "$1" @@ -89,11 +88,24 @@ html_start() #then echo "" >> "$1" + + if [ -f "./sites/$3/pages_left.html" ] + then + echo ">$(cat ./sites/$3/pages_left.html)" >> "$1" + else + echo ">$(cat ./sites/$3/tmp_pagesl)" >> "$1" + fi #fi # right nav-bar end - echo "" >> "$1" + + if [ -f "./sites/$2/pages_right.html" ] + then + echo ">$(cat ./sites/$2/pages_right.html)" >> "$1" + else + echo ">$(cat ./sites/$2/tmp_pagesr)" >> "$1" + fi fi # left nav-bar end @@ -378,6 +396,21 @@ site_process() SUBTITLE=$(cat "$SUBDIR/title") SUBOUTFILE="./out/$1/${ID_NAME}_${SUBID_NAME}.html" + # handle sub-pages + find "./sites/$1/pages_left/$ID_NAME/" -mindepth 2 -maxdepth 2 -name title | sort | while read SUBLINE + do + ZUPSUBDIR=$(dirname "$ZUPSUBLINE") + ZUPSUBID_NAME=$(basename "$ZUPSUBDIR") + ZUPSUBTITLE=$(cat "$ZUPSUBDIR/title") + ZUPSUBOUTFILE="./out/$1/${ID_NAME}_${SUBID_NAME}_${ZUPSUBID_NAME}.html" + + # generate the individual news page + html_start "$ZUPSUBOUTFILE" "$TITLE - $SUBTITLE - $ZUPSUBTITLE" "$1" + pagedump "$ZUPSUBDIR/content" >> "$ZUPSUBOUTFILE" + html_end "$ZUPSUBOUTFILE" "$1" + done + + # generate the individual news page html_start "$SUBOUTFILE" "$TITLE - $SUBTITLE" "$1" pagedump "$SUBDIR/content" >> "$SUBOUTFILE"
> "$1" safecat "./sites/$3/etc/navtd" >> "$1" - echo ">$(cat ./sites/$3/tmp_pagesl)" >> "$1" + if [ -f "./sites/$3/etc/content" ] + then + echo "> "$1" + cat "./sites/$3/etc/content" >> "$1" + echo ">" >> "$1" + else + echo "" >> "$1" + fi # after this, we're expected to put content into this column... } @@ -104,11 +116,17 @@ html_end() # end of content here! # left nav-bar start - if [ -d "./sites/$2/pages_right" ] + if [ -d "./sites/$2/tmp_pagesr" ] then echo "> "$1" safecat "./sites/$2/etc/navtd" >> "$1" - echo ">$(cat ./sites/$2/tmp_pagesr)