summaryrefslogtreecommitdiffstats
path: root/make_html
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-08-07 02:23:06 -0700
committeryum <yum.food.vr@gmail.com>2026-08-07 02:23:39 -0700
commit6c8a113c7416056ea8c404307f15e9f6c3db3b28 (patch)
tree770a677d5415aa5f7ab5079540648e7ca8e3917f /make_html
parent04c226c0b71feaf79d07d6cb5f0df001d72126e5 (diff)
water planHEADmaster
also add local mode to build script, and fix the template's title issue (would say index; now says the title).
Diffstat (limited to 'make_html')
-rwxr-xr-xmake_html15
1 files changed, 13 insertions, 2 deletions
diff --git a/make_html b/make_html
index fe42448..fdc8133 100755
--- a/make_html
+++ b/make_html
@@ -2,13 +2,18 @@
MARKDOWN_IN="$1"
[ -z "$MARKDOWN_IN" ] && { echo "Script requires one markdown argument."; exit 1; }
+if [ $# -eq 2 ]; then
+ LOCAL_MODE=1
+fi
set -o errexit
set -o xtrace
OUTPUT_DIR="site_generated"
-[ -d "$OUTPUT_DIR" ] && rm -r "$OUTPUT_DIR"
-mkdir "$OUTPUT_DIR"
+[ ! $LOCAL_MODE ] && [ -d "$OUTPUT_DIR" ] && rm -r "$OUTPUT_DIR"
+if [ ! -d "$OUTPUT_DIR" ]; then
+ mkdir "$OUTPUT_DIR"
+fi
pandoc \
--mathml \
@@ -20,6 +25,12 @@ pandoc \
-o "$OUTPUT_DIR/site.zip" \
"$MARKDOWN_IN"
+if [ $# -eq 2 ]; then
+ # Local mode
+ unzip -o "$OUTPUT_DIR/site.zip" -d "$OUTPUT_DIR"
+ exit
+fi
+
unzip -o "$OUTPUT_DIR/site.zip" -d /var/www/html/
cp -r vr_assets /var/www/html/
cp -r images /var/www/html/