Ind.ie is now Small Technology Foundation.
Commit ec64a311 authored by Aral Balkan's avatar Aral Balkan

Now using Indie Web Server for live sync deployment

parent 821bf141
#!/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
}
################################################################################
#
# ar.al live deployment script.
#
# Uses Hugo (gohugo.io) and Indie Web Server (ind.ie/web-server).
#
################################################################################
# With thanks to Job Vranish for his awesome tutorial
# on starting/stopping background processes in Bash:
......@@ -15,10 +14,7 @@ runInBackground(){
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 +25,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://ar.al --appendPort=false
hugo server --renderToDisk --baseURL=https://ar.al --appendPort=false &
# Start Indie Web Server to sync the live folder to my site and also proxy
# hugo server to https://localhost for local development with live reload.
web-server sync ../live/ ar.al --account=ubuntu --folder=site --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