summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2020-12-11 18:38:55 -0500
committereudoxia <uplink@distress.network>2020-12-11 18:38:55 -0500
commit0f3293ce2a9d9563087bb00b29db31aa1f06f961 (patch)
treeddd746701df6f27a6b8187f2ce2b3135d1dcd2e6
parent7c9332beb196ebe8f7e4c886fa94f226bce31ac0 (diff)
fixed sitemap injection behaviour, fixed reload.sh sequencing, other misc improvements
-rwxr-xr-xmd.sh12
-rwxr-xr-xreload.sh8
2 files changed, 11 insertions, 9 deletions
diff --git a/md.sh b/md.sh
index 224de56..afdce35 100755
--- a/md.sh
+++ b/md.sh
@@ -5,9 +5,9 @@ set -e
# ./md.sh <target dir>
# ./md.sh <input md> <output html>
#
-# input: <target dir>/src.md ; ./md-header ; ./md-footer
+# input: <target dir>/src.md ./md-header ./md-footer <site root>/nav.html
# output: <target dir>/index.html
-# dependencies: lowdown, fzf, ./urlencode
+# dependencies: lowdown fzf ./urlencode
# Copyright 2019-2020 DistressNetwork° <uplink@distress.network>
#
@@ -86,9 +86,11 @@ METADESC="\&laquo\;${BOMBER}\&raquo\; \&mdash\; ${LEADING}"
sed "s;<meta name=\"description\" content=\"#;<meta name=\"description\" content=\"${METADESC};1" -i'' $OUT
printf '[ok] meta description\n'
-NAVLINE=$(grep -n '<nav>' $OUT | cut -f 1 -d :)
-sed "${NAVLINE}r distress.network/nav.html" -i'' $OUT
-printf '[ok] sitemap\n'
+if [ -f $(echo $IN | cut -f 1 -d /)/nav.html ] ; then
+NAVLINE=$(grep -n '<nav>' $OUT | cut -f 1 -d :) ;
+sed "${NAVLINE}r $(echo $OUT | cut -f 1 -d /)/nav.html" -i'' $OUT ;
+printf '[ok] sitemap\n' ;
+fi
[ "$(grep -n '<p><img' $OUT)" ] && {
diff --git a/reload.sh b/reload.sh
index 311492d..af9044c 100755
--- a/reload.sh
+++ b/reload.sh
@@ -7,16 +7,16 @@ while IFS='' read -r data ; do
sh ./md.sh ${data} > /dev/null ;
echo " built: ${data}" ;
done
-echo "[ok] full rebuild"
}
+sh ./nav.sh distress.network distress.network/nav.html > /dev/null
+echo "[ok] nav embed"
+
if [ "$1" = -r ] ; then
rebuild ;
+ echo "[ok] full rebuild";
fi
-sh ./nav.sh distress.network distress.network/nav.html > /dev/null
-echo "[ok] nav embed"
-
sh ./plain.sh distress.network/nav.html distress.network/meta/sitemap/index.html > /dev/null
sed 's/\(line-height:\) 1.5em/\1 1.25em/' -i'' distress.network/meta/sitemap/index.html
echo "[ok] nav page"