#!/usr/bin/env bash # Build the static wiki site and run Pagefind for search indexing. # Usage: scripts/build.sh set -e cd "$(dirname "$0")/.." ROOT="$(pwd)" # Symlink wiki pages into the site's content collection mkdir -p pages mkdir -p site/src/content/entries LINK="$ROOT/site/src/content/entries/_wiki" if [ ! -L "$LINK" ]; then ln -sf "$ROOT/pages" "$LINK" echo "Linked pages/ → site/src/content/entries/_wiki" fi # Build Astro site cd site && npm run build cd "$ROOT" # Run Pagefind to index the static output if command -v pagefind &>/dev/null; then echo "Running Pagefind..." pagefind --site site/dist else echo "Pagefind not installed — skipping search index (npm install -g pagefind)" fi echo "Build complete: site/dist/"