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"