From e606ff0b55e3c0f81515ec6367df6943e72e614e Mon Sep 17 00:00:00 2001
From: Sjoerd Simons <sjoerd@collabora.com>
Date: Wed, 24 Mar 2021 09:46:51 +0100
Subject: [PATCH] Add helper script to build/run the site locally

While developing pages it's quite useful to be able to run and browse
the website locally; Add a trivial helper script to setup a docker
container to do just that.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
---
 run-hugo.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100755 run-hugo.sh

diff --git a/run-hugo.sh b/run-hugo.sh
new file mode 100755
index 000000000..be4e99877
--- /dev/null
+++ b/run-hugo.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Run hugo in server mode and let it bind on all interface in the container
+# such that docker can forward it properly.
+
+# Website will be available at  http://localhost:1313/ while this is running
+REPO=$(dirname $(realpath $0))
+
+docker run \
+  -p 1313:1313/tcp \
+  -u $(id -u) \
+  -v ${REPO}:/src \
+  klakegg/hugo \
+  server
-- 
GitLab