fix links in indices

main
Jonathan Dahan 12 months ago
parent cbd6f9992b
commit 46bf36ed62

@ -1,24 +1,22 @@
#!/bin/sh #!/bin/sh
#set -e set -e
if [ ! $# = 1 ]; then if [ ! $# = 1 ]; then
printf >&2 "Usage: %s <path> [ext]\n" "$(basename "$0")" printf >&2 "Usage: %s <path> [ext]\n" "$(basename "$0")"
exit 0 exit 0
fi fi
printf >&2 "hello world from %s" "$p" _path="$1"
ext="${2:-md}"
p="$1" if [ ! -d "$_path" ]; then
t="${2:-md}" printf >&2 "error: path %s not found\n" "$_path"
if [ ! -d "$p" ]; then
printf >&2 "error: path %s not found\n" "$p"
exit 1 exit 1
fi fi
find "$p" -type f -name "*.$t" | sort -r | while read -r file; do find "$_path" -type f -name "*.$ext" | sort -r | while read -r file; do
name="${file#"$p"}" name="${file#"$_path"}"
name="${name#"/"}" name="${name#"/"}"
name="${name%.*}" name="${name%.*}"
# skip indices # skip indices
@ -32,8 +30,8 @@ find "$p" -type f -name "*.$t" | sort -r | while read -r file; do
postdate="$(zs vars "$file" postdate)" postdate="$(zs vars "$file" postdate)"
if [ -z "$postdate" ]; then if [ -z "$postdate" ]; then
inputdate=$(basename $file | cut -d- -f1-3) 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 fi
echo "- <span>$postdate</span> [$title](${p}/${name}.html)" echo "- <span>$postdate</span> [$title](${name}.html)"
done done

@ -1,3 +1,5 @@
<video controls width=640><source src=banana.mp4 type="video/mp4" /></video> <video controls width=640><source src=banana.mp4 type="video/mp4" /></video>
physically programmable space, at [recurse center](recurse.com) physically programmable space, at [recurse center](recurse.com)
{{ index making }}

Loading…
Cancel
Save