2023-09-14 16:54:39 -04:00
|
|
|
#! /bin/env bash
|
|
|
|
|
|
|
|
CONTENT="${CONTENT:-content}"
|
|
|
|
SITE_ENV="${SITE_ENV:-${CONTENT}/site-env}"
|
|
|
|
|
|
|
|
curate="${curate:-about}"
|
|
|
|
index="${index:-index}"
|
|
|
|
|
2023-09-14 17:05:25 -04:00
|
|
|
mkdir -p ${CONTENT}
|
|
|
|
|
2023-09-14 16:54:39 -04:00
|
|
|
# Confirm overwrite of configuration
|
|
|
|
if [[ -r ${SITE_ENV} ]]
|
|
|
|
then
|
|
|
|
read -N 1 -p "Overwrite configuration in ${SITE_ENV} Y/N [Y]? " overwrite
|
|
|
|
if [[ "${overwrite}" = "y" ]] # TODO accept upper of lower y
|
|
|
|
then
|
|
|
|
rm -f ${SITE_ENV}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "List directories of curated content that will NOT be automatically indexed: "
|
|
|
|
echo "(default: ${curate})"
|
|
|
|
read -p "> " curate
|
|
|
|
echo "CURATE_DIRS=${curate}" >> ${SITE_ENV}
|
|
|
|
|
|
|
|
echo "List directories of curated content that WILL be automatically indexed: "
|
|
|
|
echo "(default: ${index})"
|
|
|
|
read -p "> " index
|
|
|
|
echo "INDEX_DIRS=${index}" >> ${SITE_ENV}
|
|
|
|
|
|
|
|
echo "Enter URL for content:"
|
|
|
|
read -p "> " content_url
|
|
|
|
echo "GEMINI_SITE=${content_url}" >> ${SITE_ENV}
|
|
|
|
|
|
|
|
echo "Enter URL of the Gemini site:"
|
|
|
|
read -p "> " gemini_url
|
|
|
|
echo "GEMINI_URL=${gemini_url}" >> ${SITE_ENV}
|
|
|
|
|
|
|
|
echo "\nCreated ${SITE_ENV}:\n"
|
|
|
|
cat "${SITE_ENV}"
|