notes/build.sh
2025-06-13 21:57:22 +01:00

38 lines
730 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 -l pre.el $i -l export.el -f org-html-export-to-html --kill
done
python3 rssgen.py
for i in *.html; do
thebase="${i%%.*}"
dirname=${thebase//"-"/}
mkdir build/$dirname
mv $i build/$dirname/index.html
done
mv readme.org tempfile
for i in *.org; do
rm -f $i
done
mv tempfile readme.org
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