hugo, try aslo doing BASEURL from the environment rather than only passing to cronjob as a parameter.

This commit is contained in:
me committed 2026-11-13 19:55:38 -07:00
1 parent c79e036fa6
commit 8432fe4e2a
2 files changed
+15 -8

No files matched your search

+9 -2
View File
@@ -3,11 +3,18 @@
cd /var/www/hugo/site
FORCE="$1"
BASEURL="$2"
# Pull URL from env if it exists, otherwise var2.
BASEURL="${BASEURL:-$2}"
declare baseurl
if [[ -n "$BASEURL" ]]; then
baseurl="-b $BASEURL"
fi
echo "*** Running cronjob @ `date` ***"
echo "FORCE=$FORCE"
echo "BASEURL=$BASEURL"
echo "baseurl=$baseurl"
# Pull any updates, and if the project is already up to date, exit successfully.
git pull | grep -v "up to date"
@@ -20,7 +27,7 @@ fi
# If the project was not already up to date, build the new files for NGINX.
set -x
/usr/local/bin/hugo $BASEURL --gc --minify
/usr/local/bin/hugo $baseurl --gc --minify
set +x
status="$?"
echo "* Hugo status is '$status', FORCE is '$FORCE'."