notes/build.sh
2025-07-16 20:15:53 +01:00

46 lines
897 B
Bash
Executable file

#!/usr/bin/env bash
rm -rf build
rm -f feed.xml
mkdir build
python3 identify.py
for i in 20*.org; do
echo Exporting $i
emacs --batch --no-site-file -l pre.el $i -l export.el -f org-html-export-to-html --kill
done
python3 comproc.py
for i in 20*.html; do
if test -f comm-$i; then
sed -i -e "/<!-- comments go here -->/{r comm-$i" -e "d}" $i
fi
done
python3 rssgen.py
for i in 20*.html; do
thebase="${i%%.*}"
dirname=${thebase//"-"/}
mkdir build/$dirname
mv $i build/$dirname/index.html
done
for i in 20*.org; do
rm -f $i
done
for i in comm*.html; do
rm -f $i
done
rclone copy build prazevps:/var/www/tre/public/notes -P
rclone copyto feed.xml prazevps:/var/www/tre/public/feed.xml -P
current_date=$(date +"%Y%m%d")
curl -i -d "source=https://tre.praze.net/notes/$current_date&target=https://fed.brid.gy/" https://fed.brid.gy/webmention