Files
brutsalvadi c01def696c Initialize bincio_wiki project structure
- Add brutsalvadi/astro-bloomz as git submodule at site/
- Add edit/ FastAPI sidecar (read/write markdown pages, trigger rebuild)
- Add scripts/dev.sh and scripts/build.sh (symlink pages/, run Astro + Pagefind)
- Add .gitignore
2026-04-22 22:54:19 +02:00

30 lines
750 B
Bash
Executable File

#!/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/"