From f436cfc1d05dcf085e164d46ed2604d6a7b27dc4 Mon Sep 17 00:00:00 2001 From: "ryan.mcgee" Date: Mon, 18 Aug 2025 15:17:21 -0500 Subject: [PATCH] added wrangler.toml and build.sh for Cloudflare Workers --- build.sh | 24 ++++++++++++++++++++++++ wrangler.toml | 14 ++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 build.sh create mode 100644 wrangler.toml diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..b5dd906 --- /dev/null +++ b/build.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +main() { + ZOLA_VERSION=0.21.0 + + export TZ=America/Chicago + + # Install Zola + echo "Installing Zola ${ZOLA_VERSION}..." + curl -sLJO "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v{$ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + mkdir "${HOME}/.local/zola" + tar -C "${HOME}/.local/zola" -xf "zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + rm "zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + export PATH="${HOME}/.local/zola:${PATH}" + + # Build the site + echo "Building the site..." + uglifyjs static/js/script.js --mangle > static/js/script.min.js + uglifycss static/css/style.css > static/css/style.min.css + zola build --minify +} + +set -euo pipefail +main "$@" diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..582e3fb --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,14 @@ +name = "zola-worker" +compatibility_date = "2025-08-18" +workers_dev = true + +routes = [ + { pattern = "minecraft.enclaveis.com", custom_domain = true } +] + +[build] +command = './build.sh' + +[assets] +directory = "./public/" +not_found_handling = "404-page"