summaryrefslogtreecommitdiff
path: root/update.sh
blob: 1259e4a8a10d61847e8ac82fd2bd251bdf69bc31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

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 - %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