TARGET=$1
if [ $# -ne 1 ]; then
    exit
fi
ROOT=$(cd $(dirname $0); pwd)
curl -#L -o /tmp/kakuyomu-old.css https://cdn-static.kakuyomu.jp/css/kakuyomu.css
purifycss /tmp/kakuyomu-old.css ${ROOT}/template.html ${ROOT}/../*.html ${ROOT}/../static/kakuyomu.js --out ${TARGET} --info
sed -e "s@/font/dcsymbols-regular.woff?6tnyRgzhZFkJ@dcsymbols-regular.woff@" -i ${TARGET}
sed -e "s@/font/dcsymbols-regular.otf?VjSwft_YX8ck@dcsymbols-regular.otf@" -i ${TARGET}
sed -e "s@/font/dcicons-regular.eot?OicIuNS6IwQE@dcicons-regular.eot@g" -i ${TARGET}
sed -e "s@/font/dcicons-regular.otf?woyfFEfr8EbA@dcicons-regular.otf@" -i ${TARGET}
sed -e "s@.isTouch #globalHeaderTouch-globalNav img@.isTouch #globalHeaderTouch-globalNav svg@" -i ${TARGET}
rm -f /tmp/kakuyomu-old.css