Merge pull request #2608 from messense/netlify-preview-main

netlify: redirect to `main/` for deploy previews
This commit is contained in:
David Hewitt 2022-09-07 07:42:03 +01:00 committed by GitHub
commit 7827393f26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 "<meta http-equiv=refresh content=0;url=v${PYO3_VERSION}/>" > netlify_build/index.html
if [ "${CONTEXT}" == "deploy-preview" ]; then
echo "<meta http-equiv=refresh content=0;url=main/>" > netlify_build/index.html
else
echo "<meta http-equiv=refresh content=0;url=v${PYO3_VERSION}/>" > 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