local 869 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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.
#
# 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.
14
15
16
17
hugo server --buildDrafts --renderToDisk --baseURL=https://ind.ie --appendPort=false &
HUGO_SERVER_PID=$!

# Use Indie Web Server as a reverse proxy to serve the site at https://localhost
18
web-server proxy localhost:1313
19
20
21

# Clean up: kill the Hugo server before exiting.
kill $HUGO_SERVER_PID