docs: redirect from index to dev

This commit is contained in:
Anand Balakrishnan 2023-10-13 15:36:38 -07:00
parent f510f0067b
commit dbd20fa0cd
3 changed files with 13 additions and 1 deletions

View file

@ -101,7 +101,9 @@ jobs:
- name: Build Python package - name: Build Python package
run: maturin develop --release --manifest-path pyargus/Cargo.toml run: maturin develop --release --manifest-path pyargus/Cargo.toml
- name: Build HTML docs - name: Build HTML docs
run: sphinx-multiversion docs _site -b html run: |
sphinx-multiversion docs _site -b html
cp ./docs/_templates/index-redirect.html _site/index.html
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')

9
docs/_templates/index-redirect.html vendored Normal file
View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to master branch</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./master/index.html">
<link rel="canonical" href="/dev/index.html">
</head>
</html>

View file

@ -49,6 +49,7 @@ def docs(session: nox.Session):
with session.chdir(CURRENT_DIR / "pyargus"): with session.chdir(CURRENT_DIR / "pyargus"):
session.install("-e", ".") session.install("-e", ".")
session.run("sphinx-multiversion", "docs", "_site", "-b", "html") session.run("sphinx-multiversion", "docs", "_site", "-b", "html")
session.run("cp", "./docs/_templates/index-redirect.html", "_site/index.html")
@nox.session(tags=["style", "fix", "rust"], python=False) @nox.session(tags=["style", "fix", "rust"], python=False)