#!/usr/bin/env bash set -euo pipefail OUT_DIR="${1:-.faircamp_build}" SITE_URL="${2:-https://st33v.com}" cd "$OUT_DIR" # --- robots.txt --- cat > robots.txt < "$tmp" { printf '%s\n' '' printf '%s\n' '' while IFS=$'\t' read -r path lastmod; do # Escape ampersands minimally url="${SITE_URL%/}/$(printf '%s' "$path" | sed 's/&/\&/g')" printf ' %s%s\n' "$url" "$lastmod" done < "$tmp" printf '%s\n' '' } > sitemap.xml rm -f "$tmp" echo "Wrote: $OUT_DIR/robots.txt" echo "Wrote: $OUT_DIR/sitemap.xml"