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

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\n' $f "$(awk -- "$GEN_TITLE" $f)"
done | sort -r >> index-all.gmi

echo Updating index.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