Skip to content

Commit 47fb157

Browse files
authored
Add redirects for relocated docs (#10221)
### Summary We've moved a number of doc pages in 0.6. This PR adds the sphinx-reredirects extension, which adds a sphinx feature to define redirected doc pages. I've used this to declare redirects for key relocated doc pages to preserve SEO and incoming external links. Solves #8728. ### Test plan I've locally built and served the docs and navigated to each of the redirected URLs. I confirmed that all redirect as expected. cc @mergennachin @byjlw
1 parent 9a3b555 commit 47fb157

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.ci/docker/requirements-ci.txt

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ parameterized==0.9.0
1717

1818
# Doc build requirements, same as https://github.com/pytorch/pytorch/blob/main/.ci/docker/requirements-docs.txt
1919
sphinx==5.3.0
20+
sphinx-reredirects==0.1.4
2021
sphinx-gallery==0.14.0
2122
breathe==4.34.0
2223
exhale==0.2.3

docs/source/conf.py

+19
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"myst_parser",
6363
"sphinx_design",
6464
"sphinx_gallery.gen_gallery",
65+
"sphinx_reredirects",
6566
]
6667

6768
if not FBCODE:
@@ -195,6 +196,24 @@
195196
"torch": ("https://pytorch.org/docs/stable/", None),
196197
}
197198

199+
# Redirects for moved pages
200+
redirects = {
201+
"getting-started-setup": "getting-started.html",
202+
"export-overview": "using-executorch-export.html",
203+
"runtime-build-and-cross-compilation": "using-executorch-building-from-source.html",
204+
"tutorials/export-to-executorch-tutorial": "../using-executorch-export.html",
205+
"running-a-model-cpp-tutorial": "using-executorch-cpp.html",
206+
"build-run-vulkan": "backends-vulkan.html",
207+
"executorch-arm-delegate-tutorial": "backends-arm-ethos-u.html",
208+
"build-run-coreml": "backends-coreml.html",
209+
"build-run-mediatek-backend": "backends-mediatek.html",
210+
"build-run-mps": "backends-mps.html",
211+
"build-run-qualcomm-ai-engine-direct-backend": "backends-qualcomm.html",
212+
"build-run-xtensa": "backends-cadence.html",
213+
"apple-runtime": "using-executorch-ios.html",
214+
"tutorials/devtools-integration-tutorial": "../using-executorch-troubleshooting.html",
215+
}
216+
198217
# Custom directives defintions to create cards on main landing page
199218

200219
from custom_directives import ( # type: ignore[import-not-found]

0 commit comments

Comments
 (0)