Site Development Workflow
Efficient development workflows make building sites with Super Simple Includes fast and enjoyable.
File Watching with Auto-Rebuild
Watch your site files and automatically rebuild when changes are detected using inotifywait:
Installation
# Ubuntu/Debian
sudo apt install inotify-tools
Watch and Serve Script
This script rebuilds on file changes and serves the output on a local port:
#!/bin/bash
# dev-server.sh
SITE_DIR="${1:-site}"
OUTPUT_DIR="${2:-output}"
PORT="${3:-8000}"
mkdir -p "$OUTPUT_DIR"
# Initial build
echo "Building site..."
ssi deploy "$SITE_DIR" "$OUTPUT_DIR" || { echo "Initial build failed"; exit 1; }
# Start local server in background
python -m http.server "$PORT" --directory "$OUTPUT_DIR" &
SERVER_PID=$!
echo "Serving at http://localhost:$PORT"
# Stop server on exit
trap 'kill $SERVER_PID; exit' INT TERM
# Watch for changes
echo "Watching $SITE_DIR for changes. Press Ctrl+C to stop."
inotifywait -m -r -e modify,create,delete,move "$SITE_DIR" \
--exclude '.*\.sw[px]$|.*~$' \
--format '%w%f' |
while read -r file; do
echo "Changed: $file — rebuilding..."
ssi deploy "$SITE_DIR" "$OUTPUT_DIR" && echo "Build complete." || echo "Build failed."
done
Usage
chmod +x dev-server.sh
# Default: site/ → output/ on port 8000
./dev-server.sh
# Custom paths and port
./dev-server.sh my-site/ build/ 9000
Integration with Editors
VS Code Tasks
Add to .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "SSI: Start Development Server",
"type": "shell",
"command": "./dev-server.sh",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "new"
}
}
]
}
Vim/Neovim
Auto-build on save:
autocmd BufWritePost *.html,*.md,*.toml silent !ssi deploy site/ output/