Static conversion complete
This page was generated because no index.php existed.
Edit this file to match your layout.
#!/usr/bin/env bash set -euo pipefail echo "==> Staticize: PHP → HTML conversion" # 1) Backup all PHP files preserving structure if [ -d "_backup_php" ]; then echo "[skip] _backup_php already exists" else echo "Backing up *.php to _backup_php/" find . -type f -name "*.php" -print0 | tar --null -T - -cf - | (mkdir -p _backup_php && tar -xf - -C _backup_php) fi # 2) Convert each .php to .html stripping PHP blocks echo "Converting PHP to HTML (strip blocks)" php_count=0 while IFS= read -r -d '' f; do php_count=$((php_count+1)) rel="${f#./}" out="${rel%.php}.html" outdir="$(dirname "$out")" mkdir -p "$outdir" # Remove all PHP code blocks including multiline # Note: GNU sed required. macOS: use 'gsed' (brew install gnu-sed) or run via Docker. sed -E 's/<\?php[\s\S]*?\?>//g' "$f" > "$out" done < <(find . -type f -name "*.php" -print0) echo "Converted $php_count PHP files." # 3) Rewrite internal links .php → .html across common text assets echo "Rewriting internal links from .php to .html" files_to_patch=$(find . -type f \( -name "*.html" -o -name "*.htm" -o -name "*.css" -o -name "*.js" -o -name "*.md" -o -name "*.txt" -o -name "*.xml" -o -name ".htaccess" \) ! -path "./_backup_php/*") while IFS= read -r file; do # Use in-place edit (GNU sed). macOS: gsed -i sed -i -E 's/\.php\b/.html/g' "$file" || true done <<< "$files_to_patch" # 4) Ensure index.html at repo root if [ ! -f "./index.html" ]; then if [ -f "./index.php" ]; then echo "Creating index.html from index.php" sed -E 's/<\?php[\s\S]*?\?>//g' "./index.php" > "./index.html" else echo "No index.php found; creating a minimal index.html" cat > ./index.html <<'EOF'
This page was generated because no index.php existed.
Edit this file to match your layout.