diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..f312935 --- /dev/null +++ b/build.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -euo pipefail + +HUGO_VERSION=0.148.2 +GO_VERSION=1.24.5 + +export TZ=Europe/Oslo + +# Install Go +echo "Installing Go ${GO_VERSION}..." +curl -sLJO "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" +tar -C "${HOME}/.local" -xf "go${GO_VERSION}.linux-amd64.tar.gz" +rm "go${GO_VERSION}.linux-amd64.tar.gz" +export PATH="${HOME}/.local/go/bin:${PATH}" + +# Install Hugo +echo "Installing Hugo ${HUGO_VERSION}..." +curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" +mkdir "${HOME}/.local/hugo" +tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" +rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" +export PATH="${HOME}/.local/hugo:${PATH}" + +# Verify installations +echo "Verifying installations..." +echo Go: "$(go version)" +echo Hugo: "$(hugo version)" + +# Configure Git +echo "Configuring Git..." +git config core.quotepath false +if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then + git fetch --unshallow +fi + +echo "Building site..." +hugo --gc --minify diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..425ec72 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,8 @@ +name = "blog" +compatibility_date = "2025-08-16" + +[build] +command = "./build.sh" + +[assets] +directory = "./public"