You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
368 B

#!/bin/sh
set -e
if [ ! $# = 1 ]; then
printf >&2 "Usage: %s <path> [ext]\n" "$(basename "$0")"
exit 0
fi
p="$1"
t="${2:-md}"
if [ ! -d "$p" ]; then
printf >&2 "error: path %s not found\n" "$p"
exit 1
fi
find "$p" -type f -name "*.$t" | grep -v 'index.md$' | sort -r | head -n1 | while read -r file; do
ZS_LAYOUT=embed.html zs build $file
done