From 973ff0813f67af319868ba465e6817dc4cbc730b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 3 Apr 2015 13:53:31 -0700 Subject: Add backlinks to backlinks --- trunk/backlink.head | 1 + trunk/backlink.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'trunk') diff --git a/trunk/backlink.head b/trunk/backlink.head index 7557740..816ee7d 100644 --- a/trunk/backlink.head +++ b/trunk/backlink.head @@ -1,5 +1,6 @@ --- title: _TITLE_ +id: _ID_ subtitle: back-links genre: list diff --git a/trunk/backlink.sh b/trunk/backlink.sh index 15bb11e..c9740d9 100644 --- a/trunk/backlink.sh +++ b/trunk/backlink.sh @@ -20,10 +20,12 @@ if ! grep -ql "$searchQuery" $glob >> "$outFile"; then echo "- [$title]($searchQuery)" >> "${islandLink}.txt" fi -# Change title of $outFile +# Change title & id of $outFile inText="`basename $searchQuery .html`.txt"; title=`grep '^title:' "$inText" | cut -d' ' -f2-`; +id=`grep '^id:' "${searchQuery%.html}.txt" | cut -d' ' -f2`; sed -i "s/_TITLE_/$title/" "$outFile"; +sed -i "s/_ID_/$id/" "$outFile"; echo -n "." # Change *.txt to *.html -- cgit 1.4.1-21-gabe81