From bd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 2 Apr 2015 17:34:26 -0700 Subject: Fix #15: add compile support for indeces --- trunk/common-titles.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 trunk/common-titles.sh (limited to 'trunk/common-titles.sh') diff --git a/trunk/common-titles.sh b/trunk/common-titles.sh new file mode 100644 index 0000000..9bc0de8 --- /dev/null +++ b/trunk/common-titles.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +outFile="$1"; +header="$2"; +shift 2; +glob="$@"; + +echo -n "Compiling ${outFile}..."; +cat "$header" > $outFile; + +for file in $glob; do + # Copy title to $outFile & link + title="$(grep '^title:' "$file" | cut -d' ' -f2- | sed 's/"//g')"; + if (( $RANDOM % 13 == 0 )); then + echo -n "| "; + else + echo -n " "; + fi + echo "[$title](${file%.*}.html)" >> "$outFile"; +done +echo "Done."; -- cgit 1.4.1-21-gabe81