From 9fce418b46c9f0894f429384ef9e3dabaeffbeb4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 14 Apr 2015 16:36:17 -0700 Subject: Change file hierarchy and rewrite makefile - File hierarchy is now as follows: - / - appendix/ < appendix source files - backlinks/ < backlink sources & builds - hapax/ < *.hapax source files - scripts/ < scripts, like *.js, *.hs, etc. - templates/ < templates for outputs - text/ < source files - trunk/ < assets, like css, images, heads, etc. - index.html - *.html - Makefile --- trunk/backlink.sh | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 trunk/backlink.sh (limited to 'trunk/backlink.sh') diff --git a/trunk/backlink.sh b/trunk/backlink.sh deleted file mode 100644 index f6feb7d..0000000 --- a/trunk/backlink.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Command-line variables -searchQuery="$1"; # .html file to backlink -outFile="$2"; # .back file to create -headerFile="$3"; # header information file -shift 3; -glob="$@"; # where to search for backlinks - -# Find backlinkers -echo -n "Back-linking \"$searchQuery\"" -cat "$headerFile" > "$outFile"; -if ! grep -ql "$searchQuery" $glob >> "$outFile"; then - echo "[_island_](${islandLink}.htm)." >> "$outFile"; - title=`grep '^title:' "${searchQuery%.html}.txt" | cut -d' ' -f2-`; - echo "- [$title]($searchQuery)" >> "${islandLink}.txt" -fi - -# 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 -sed -i 's/^\(.*\)\.txt/\1.html/g' "$outFile"; - -# Link to backlinks -for file in `grep '.html$' "$outFile"`; do - fText="`basename $file .html`.txt"; - title=`grep '^title:' $fText | cut -d' ' -f2-`; - sed -i "s/^$file$/- [$title](&)/" "$outFile"; - echo -n "." -done - -echo "Done." -- cgit 1.4.1-21-gabe81