websites/upload.sh

28 lines
557 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_KEY
# build site
if [ "$ENGINE" = "hugo" ]; then
hugo -s "$1" -d "../$SITE_DIR"
fi
if [ "$ENGINE" = "eleventy" ]; then
currentdir=$(pwd)
cd $1
npx @11ty/eleventy
cd $SITE_DIR
neocities upload *
cd $currentdir
fi
rm -fr $SITE_DIR