fix missing 4.x doc links#9510
Open
GautamKumarOffical wants to merge 1 commit into
Open
Conversation
The site nav only linked to 5.x API docs, and there was no fallback for 4.x URLs. Users following old links to /4.x/okhttp/okhttp3/ would hit dead ends. - Add 4.x API entry to mkdocs.yml nav alongside 5.x - Generate a redirect page (docs/4.x/) in both deploy_website.sh and test_docs.sh that maps /4.x/* paths to their 5.x equivalents - Works with both JS-enabled and no-JS browsers (meta refresh fallback) Fixes square#9156
JakeWharton
reviewed
Jun 25, 2026
| <p>OkHttp 4.x API docs have moved. Redirecting to <a href="../../5.x/okhttp/okhttp3/">5.x API docs</a>…</p> | ||
| </body> | ||
| </html> | ||
| REDIRECT |
Collaborator
There was a problem hiding this comment.
Why are we writing the same code out here and below if it's also checked in?
| - 'API': 5.x/okhttp/okhttp3/ | ||
| - 'API': | ||
| - '5.x': 5.x/okhttp/okhttp3/ | ||
| - '4.x': 4.x/okhttp/okhttp3/ |
Collaborator
There was a problem hiding this comment.
Why would we link to the 4.x docs if it's going to immediately redirect to the 5.x ones?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9156
The site nav only linked to 5.x API docs with no 4.x entry, and there was no redirect fallback for old
/4.x/URLs. Users following old links or bookmarks to 4.x API docs would get 404s.Changes:
4.xentry under theAPInav inmkdocs.ymlalongside5.xdeploy_website.shandtest_docs.shnow generate adocs/4.x/redirect page that maps/4.x/*→/5.x/*using JS + meta refresh fallbackdocs/4.x/okhttp/okhttp3/index.html