From e0367536eabee3d416022dd8346680a34240424b Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Thu, 10 Sep 2020 16:35:06 +0200 Subject: [PATCH] more bugfixes --- rivet.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rivet.sh b/rivet.sh index 56cfd2d..3eed5fb 100755 --- a/rivet.sh +++ b/rivet.sh @@ -65,6 +65,8 @@ fi src="$1" srcdir=${src%%\/} unset src +headerfile=$srcdir/_header.html +footerfile=$srcdir/_footer.html # Check if index.md is present if ! [ -e "$srcdir"/index.md ]; then @@ -93,9 +95,6 @@ url="$(echo "$2" | sed -e 's/\/$//' | sed -e 's/[]\/$*.^[]/\\&/g')" -headerfile=$srcdir/_header.html -footerfile=$srcdir/_footer.html - if [ "$PRINT_HELP" ]; then usage fi @@ -153,7 +152,7 @@ if ! [ "$SKIP_SITEMAP" ] || ! [ "$SKIP_LIST" ]; then rm -f "$tmpfile" cat << EOF >> "$tmpfile"
-

"$linksec"

+

$linksec

EOF while IFS="" read -r line; do if echo "$line" | grep -q 'index\.html'; then @@ -161,7 +160,7 @@ EOF fi title="$(grep -e '^.*<\/title>' "$destdir"/"$line" | sed -e 's/<title>//' -e 's/<\/title>//')" - if ! [ "$title" ]; then + if ! [ "$title" ] || echo "$title" | grep -q 'Untitled article'; then title=${line%?????} fi printf "<p><a href=\"%s\">%s</a></p>\n" "$line" "$title" >> "$tmpfile"