2024-04-16 22:06:17 -04:00
|
|
|
#!/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
|
2024-04-17 21:44:09 -04:00
|
|
|
if [ "$ENGINE" = "hugo" ]; then
|
2024-07-08 09:27:19 -04:00
|
|
|
hugo -s "$1" -d "../$SITE_DIR"
|
2024-04-17 21:44:09 -04:00
|
|
|
fi
|
|
|
|
|
2024-04-16 22:06:17 -04:00
|
|
|
# push index last to ensure resources are available
|
2024-07-08 09:27:19 -04:00
|
|
|
neocities push -e index.html "$SITE_DIR"
|
|
|
|
neocities upload "$SITE_DIR/index.html"
|
|
|
|
|
|
|
|
rm -fr $SITE_DIR
|