fix links in indices

main
Jonathan Dahan 12 months ago
parent cbd6f9992b
commit 46bf36ed62

@ -1,24 +1,22 @@
#!/bin/sh
#set -e
set -e
if [ ! $# = 1 ]; then
printf >&2 "Usage: %s <path> [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 "- <span>$postdate</span> [$title](${p}/${name}.html)"
echo "- <span>$postdate</span> [$title](${name}.html)"
done

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

Loading…
Cancel
Save