summaryrefslogtreecommitdiff
path: root/update.sh
diff options
context:
space:
mode:
authortslil clingman <>2024-02-22 20:44:48 +0100
committertslil clingman <>2024-02-22 20:44:48 +0100
commite427b7d8fc53afdebfa903d43bd8fb3b9c209cc5 (patch)
tree15d2f9aeb915808d04decbca734f3ce4272d95c1 /update.sh
parent5624ac585ec7d5ce21e5b5010930d47c74af18c4 (diff)
BQN example programme discussion
Also update update.sh to auto-generate recent post list
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/update.sh b/update.sh
index 5cb69af..1259e4a 100755
--- a/update.sh
+++ b/update.sh
@@ -3,7 +3,18 @@
echo Generating index
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\n' $f "$(grep '^# ' $f | head -n1 | cut -d\ -f2-)";
+ 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-)";
done | sort -r >> index-all.gmi
+ed index.gmi <<EOF
+/^## Recent posts/+
++,/^## Indices/-2d
+-r !tail -n +4 index-all.gmi | head -n 5
+w
+q
+EOF
+
gemfeed.py -b gemini://l-3.space -e 'hello@l-3.space' -t l-3.space -a tslil