diff --git a/.zs/index b/.zs/index index 1444c2b..f53a48d 100755 --- a/.zs/index +++ b/.zs/index @@ -1,24 +1,22 @@ #!/bin/sh -#set -e +set -e if [ ! $# = 1 ]; then printf >&2 "Usage: %s [ext]\n" "$(basename "$0")" exit 0 fi -printf >&2 "hello world from %s" "$p" +_path="$1" +ext="${2:-md}" -p="$1" -t="${2:-md}" - -if [ ! -d "$p" ]; then - printf >&2 "error: path %s not found\n" "$p" +if [ ! -d "$_path" ]; then + printf >&2 "error: path %s not found\n" "$_path" exit 1 fi -find "$p" -type f -name "*.$t" | sort -r | while read -r file; do - name="${file#"$p"}" +find "$_path" -type f -name "*.$ext" | sort -r | while read -r file; do + name="${file#"$_path"}" name="${name#"/"}" name="${name%.*}" # skip indices @@ -32,8 +30,8 @@ find "$p" -type f -name "*.$t" | sort -r | while read -r file; do postdate="$(zs vars "$file" postdate)" if [ -z "$postdate" ]; then inputdate=$(basename $file | cut -d- -f1-3) - postdate=$(date -j -f "%Y-%m-%d" "$inputdate" "+%h %Y") + postdate=$(date -j -f "%Y-%m-%d" "$inputdate" "+%h %Y" || true) fi - echo "- $postdate [$title](${p}/${name}.html)" + echo "- $postdate [$title](${name}.html)" done diff --git a/making/index.md b/making/index.md index 4a64b97..9b36c2d 100644 --- a/making/index.md +++ b/making/index.md @@ -1,3 +1,5 @@ physically programmable space, at [recurse center](recurse.com) + +{{ index making }}