summaryrefslogtreecommitdiff
path: root/md.sh
diff options
context:
space:
mode:
Diffstat (limited to 'md.sh')
-rwxr-xr-xmd.sh12
1 files changed, 7 insertions, 5 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)" ] && {