diff options
Diffstat (limited to 'update.sh')
| -rwxr-xr-x | update.sh | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,14 +1,17 @@ #!/bin/sh -echo Generating index +GEN_TITLE=' +BEGIN { show = 1; ORS=""; } +/Time-stamp/ { printf("%s - ", substr($2,2)) } +/^# / && show { print substr($0,3); show = 0 }' + +echo Generating index-all.gmi printf "# l-3.space: all\n\nAll content\n" > index-all.gmi for f in log*gmi; do - printf '=> gemini://l-3.space/%s %s - %s\n' \ - $f\ - "$(head -n1 $f | sed 's/Time-stamp: <\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\) ..h.. UTC>/\1/')"\ - "$(grep '^# ' $f | head -n1 | cut -d\ -f2-)"; + printf '=> gemini://l-3.space/%s %s\n' $f "$(awk -- "$GEN_TITLE" $f)" done | sort -r >> index-all.gmi +echo Updating index.gmi ed index.gmi <<EOF /^## Recent posts/+ +,/^## Indices/-2d |
