The live script now uses Indie Web Server

parent 5531175a
#!/bin/bash
# Runs command in requested directory in the background
# and restores the working directory at the end.
# Usage: runInBackground <directory> "<command>"
runInBackground(){
pushd $1 >/dev/null
eval $2 &
popd >/dev/null
}
# With thanks to Job Vranish for his awesome tutorial
# on starting/stopping background processes in Bash:
# https://spin.atomicobject.com/2017/08/24/start-stop-bash-background-process/
trap "exit" INT TERM ERR
trap "kill 0" EXIT
# Start the rsync deployment watcher
runInBackground ../sync "npm run sync"
# Start Hugo server.
# Start Hugo server in the background.
#
# The baseURL and appendPort flags are set to overwrite the default behaviour
# of Hugo when run with the server option which is to write absolute URLs
......@@ -29,7 +17,11 @@ runInBackground ../sync "npm run sync"
# Note: if you do not want a post live-synced, mark it as draft: true in the
# ===== front matter.
#
hugo server --renderToDisk --baseURL=https://ind.ie --appendPort=false
hugo server --renderToDisk --baseURL=https://ind.ie --appendPort=false &
# Start Indie Web Server to both proxy Hugo from port 1313 to https://localhost
# and to sync any changes to the live directory to the server.
web-server sync ../live/ --to=aral@static.ind.ie:/var/www --proxy=localhost:1313
# Don’t exit. Shutting off this process should also kill
# the two other background processes we started
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment