スクリプト
例のごとく、 <C-c> <C-v> t
で publish.sh
が書きだされるので、それを実行すれば良い。
githooks 経由で、upload する
まず、書き出しをおこなう。
# publish command emacsclient -e '(org-publish-all t)' > /dev/null
file tag が public でないものは消す。
# current directory cd $HOME/Dropbox/org/notes
# deleted drafts and private notes rg --files-without-match ':public:' *.org | sed 's/.org/.html/;s/^/..\/public\//' | xargs rm
圧縮ファイルをつくる
# compress cd ../ tar -C public -cz . > html.tar.gz
アップロードする
auth key あるから、割愛
# upload curl --silent --oauth2-bearer "{YOUR_KEY}" \ -Fcontent=@html.tar.gz \ https://pages.sr.ht/publish/yasushisakai.com > /dev/null
圧縮ファイルと public フォルダを消す
# delete archive rm html.tar.gz rm -rf public echo 'done'
ファイルの実行権限
chmod u+x $HOME/Dropbox/org/publish.sh