#!/bin/bash # Author: King Eca https://easiestsoft.com # Date: 2019-12-21 fxz=src.xz sshost=host-easiestsoft cd ~/mybook/easiestsoft.com rm --force $fxz tar --create --xz --file=$fxz $(fd --changed-within 1d --exclude 'zz_*' -E '*.xz' --type file --path-separator '//') ls -l --human-readable $fxz sftp $sshost:/home/easiestsoft.com/mdbook <<< $"put $fxz" ssh $sshost <<'ENDSSH' book=/home/easiestsoft.com/mdbook public=/home/easiestsoft.com/public out=~/out-mdbook fxz=src.xz cd $book tar --extract --xz --file=$fxz rm --force $fxz mdbook build --dest-dir $out cd $out fd -0 --extension html | xargs -0 sd --string-mode 'index.html"' '"' fd -0 --extension html | xargs -0 sd '(?:<[^>]+>){2}~-[\w\s_/-]+?-~' '' fd -0 --extension html | xargs -0 sd '(