Sample Upload Script

The following shell script will upload the contents of the current directory to your polymaths.page account.

Feel free to modify this script as you see fit, of course, or ask if you have trouble.

#!/bin/sh

if [ -n "$1" ]; then
    domain="$1"
else
    domain=`basename "$PWD"`
fi

if [ -n "$2" ]; then
    build_folder="$1"
else
    if [ -d _site ]; then
        build_folder="_site/"
    elif [ -d public ]; then
        build_folder="public/"
    else
        build_folder="$(realpath .)/"
    fi
fi

rsync --delete-during --zc=zstd --update --progress --itemize-changes --stats -r "$build_folder" "polymaths.page:~/html/$domain/"