From e468d8bc29d00466c5efb10429dba2dec4d9b6d0 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 19 Feb 2026 18:06:33 -0500 Subject: [PATCH] fix(readthedocs): dummy site for non PR builds --- scripts/readthedocs_build.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/readthedocs_build.sh b/scripts/readthedocs_build.sh index 3df8bbe0..e24ca596 100644 --- a/scripts/readthedocs_build.sh +++ b/scripts/readthedocs_build.sh @@ -32,6 +32,32 @@ echo "github url: ${github_url}" echo "github user: ${github_user}" echo "github repo: ${github_repo}" +# For non PR builds, create a dummy index.html and exit early +# ReadTheDocs sets READTHEDOCS_VERSION_TYPE to "external" for PR/external builds +rtd_version_type="${READTHEDOCS_VERSION_TYPE:-}" +echo "ReadTheDocs version type: ${rtd_version_type}" +if [[ "${rtd_version_type}" != "external" ]]; then + echo "Not a pull request build, creating dummy index.html" + output_dir="${READTHEDOCS_OUTPUT}html" + mkdir -p "${output_dir}" + cat > "${output_dir}/index.html" <<'EOF' + + +
+ + +Previews are only generated for pull requests.
+ + +EOF + echo "Dummy index.html written to ${output_dir}" + exit 0 +fi + # set default directories project_dir="." theme_dir="."