From 1698c84c00cd3a4002c3800a8e618829adb6ce53 Mon Sep 17 00:00:00 2001 From: messense Date: Wed, 7 Sep 2022 10:11:09 +0800 Subject: [PATCH] netlify: redirect to `main/` for deploy previews --- .netlify/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.netlify/build.sh b/.netlify/build.sh index 7f89b8ca..3d4eb6ee 100755 --- a/.netlify/build.sh +++ b/.netlify/build.sh @@ -17,7 +17,11 @@ cp .netlify/_redirects netlify_build/ echo "/latest/* https://pyo3.github.io/pyo3/v${PYO3_VERSION}/:splat 200" >> netlify_build/_redirects ## Add landing page redirect -echo "" > netlify_build/index.html +if [ "${CONTEXT}" == "deploy-preview" ]; then + echo "" > netlify_build/index.html +else + echo "" > netlify_build/index.html +fi ## Build guide @@ -49,7 +53,3 @@ mkdir -p netlify_build/internal mv target/doc netlify_build/internal/ ls -l netlify_build/ - -# TODO: -# - netlify badges -# - apply for open source plan