#!/usr/bin/env bash # SPDX-License-Identifier: AGPL-3.0-only set -euo pipefail repo_root=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) cd "$repo_root" public_version='' if (( $# > 0 )); then if [[ "$1" != --public || $# -ne 2 ]]; then printf 'usage: scripts/check-site.sh [--public vX.Y.Z]\n' >&2 exit 2 fi public_version=$2 fi fail() { printf 'site error: %s\n' "$*" >&2 exit 1 } for page in site/index.html site/sando/index.html; do [[ -f "$page" ]] || fail "missing $page" grep -Fq '' "$page" || fail "$page needs a document language" grep -Fq '' "$page" || fail "$page needs the skip-link target" grep -Fq '