スクリプト
例のごとく、 <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/notes
# deleted drafts and private notes rg --files-without-match ':public:' *.org | sed 's/.org/.html/;s/^/..\/website\//' | xargs rm
圧縮ファイルをつくる
# compress cd ../ tar -C public -cz . > html.tar.gz
アップロードする
scp -r ~/website/* website:website/www/
アップロードする(sr.ht)
auth key あるから、割愛
# upload curl --silent --oauth2-bearer "{YOUR_KEY}" \ -Fcontent=@html.tar.gz \ https://pages.sr.ht/publish/yasushisakai.com > /dev/null
圧縮ファイルと website フォルダを消す
# delete archive # rm html.tar.gz rm -rf $HOME/website echo 'done'
ファイルの実行権限
chmod u+x $HOME/publish.sh