websites/upload.sh

19 lines
486 B
Bash
Executable file

#!/usr/bin/env bash
# build a hugo site and upload it to neocities
# usage: ./upload.sh mestizo.monster
# inspired by: https://gitlab.com/unixispower/after-the-beep/-/blob/main/_utils/upload
# load config file
CONFIG_FILE="$1/upload.conf"
. "$CONFIG_FILE"
# export variable from config file
export NEOCITIES_API_KEY
# build site
hugo -s "$1"
# push index last to ensure resources are available
neocities push -e index.html "$1/$SITE_DIR"
neocities upload "$1/$SITE_DIR/index.html"