Commit d0d11da7 authored by Laura Kalbag's avatar Laura Kalbag
Browse files

Change local script to develop script and add stage script

Following structure set in small-tech.org repo
parent e0df075c
#!/bin/bash
# Runs just Hugo server for local authoring
# (changes will not be deployed or live streamed over the
# peer-to-peer web. For that, use the ./live script.)
# Start Hugo server.
#
......@@ -11,11 +9,11 @@
# as localhost:<port> regardless of the setting of baseURL in the config.toml
# file. Since we do not have a separate build/deploy phase to the live server,
# we want the site as it would exist on the server to exist on the client.
hugo server --buildDrafts --renderToDisk --baseURL=https://localhost --appendPort=false &
hugo server --buildDrafts --renderToDisk --baseURL=https://laurakalbag.com --liveReloadPort=443 --appendPort=false &
HUGO_SERVER_PID=$!
# Use Indie Web Server as a reverse proxy to serve the site at https://localhost
web-server proxy localhost:1313
# Use Site.js as a reverse proxy to serve the site at https://localhost
site :1313
# Clean up: kill the Hugo server before exiting.
kill $HUGO_SERVER_PID
#!/bin/bash
# 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 Indie Web Server to both proxy Hugo from port 1313 to https://localhost
# for development (with live reload support) and to sync any changes to the
# live directory to the server.
web-server sync ../live/ laurakalbag.com --account=laura --folder=site --proxy=localhost:1313 &
# Start Hugo server in the background.
# Start Hugo server.
#
# 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
# as localhost:<port> regardless of the setting of baseURL in the config.toml
# file. Since we do not have a separate build/deploy phase to the live server,
# we want the site as it would exist on the server to exist on the client.
#
# Note: if you do not want a post live-synced, mark it as draft: true in the
# ===== front matter.
#
hugo server --renderToDisk --baseURL=https://laurakalbag.com --appendPort=false --disableLiveReload
hugo server --buildDrafts --renderToDisk --baseURL=https://small-tech.org --liveReloadPort=443 --appendPort=false &
HUGO_SERVER_PID=$!
# Use Site.js as a reverse proxy to serve the site at https://hostname
# (Use ngrok to expose publicly.)
site :1313 @hostname
# Don’t exit. Shutting off this process should also kill
# the two other background processes we started
wait
# Clean up: kill the Hugo server before exiting.
kill $HUGO_SERVER_PID
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