Skip to content

Add redirects for relocated docs #10221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Apr 16, 2025

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

Copy link

pytorch-bot bot commented Apr 16, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10221

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Cancelled Job

As of commit 98cef60 with merge base ae2d822 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 16, 2025
@GregoryComer GregoryComer added topic: not user facing module: doc Issues related to documentation, both in docs/ and inlined in code labels Apr 16, 2025
@GregoryComer GregoryComer requested a review from byjlw April 16, 2025 07:48
@GregoryComer GregoryComer merged commit 47fb157 into pytorch:main Apr 16, 2025
95 of 99 checks passed
@GregoryComer
Copy link
Member Author

@pytorchbot cherry-pick --onto release/0.6 -c docs

pytorchbot pushed a commit that referenced this pull request Apr 16, 2025
### 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

(cherry picked from commit 47fb157)
@pytorchbot
Copy link
Collaborator

Cherry picking #10221

The cherry pick PR is at #10241 The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

Comment on lines +208 to +213
"build-run-coreml": "backends-coreml.html",
"build-run-mediatek-backend": "backends-mediatek.html",
"build-run-mps": "backends-mps.html",
"build-run-qualcomm-ai-engine-direct-backend": "backends-qualcomm.html",
"build-run-xtensa": "backends-cadence.html",
"apple-runtime": "using-executorch-ios.html",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we have any of these left

Copy link
Member Author

@GregoryComer GregoryComer Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the goal of this change is to make these old links point to the new pages. That way any external links (and SEO) will continue to work. I.e. if some other website links to the old "/build-run-coreml.html" page, it will auto-redirect to"/backends-coreml.html" and not be broken.

@@ -195,6 +196,24 @@
"torch": ("https://pytorch.org/docs/stable/", None),
}

# Redirects for moved pages
redirects = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a simple find\replace would work as well?

"build-run-qualcomm-ai-engine-direct-backend": "backends-qualcomm.html",
"build-run-xtensa": "backends-cadence.html",
"apple-runtime": "using-executorch-ios.html",
"tutorials/devtools-integration-tutorial": "../using-executorch-troubleshooting.html",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct. original path is correct, it will not show up until running tutorial_source/devtools-integration-tutorial.py. Let me fix that in my PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gasoonjia Can you explain more what you mean? I did manually test all of the redirected links and they worked as expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes your redirection is working, but the page you redirect to is not the one we need.

this is the one you redirected to: https://pytorch.org/executorch/0.6/using-executorch-troubleshooting.html
but this is the one we need: https://pytorch.org/executorch/0.6/tutorials/devtools-integration-tutorial.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Feel free to update the redirect link if you prefer that page.

keyprocedure pushed a commit to keyprocedure/executorch that referenced this pull request Apr 21, 2025
### 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 pytorch#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: doc Issues related to documentation, both in docs/ and inlined in code topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants