Skip to content
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

fix(v1): versioned_docs and skip-next-release relative path issue #3429

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

josephMG
Copy link
Contributor

Motivation

(Write your motivation here.)

Have you read the Contributing Guidelines on pull requests? YES

Due to #1805, reduxjs/react-redux#1583 and reduxjs/react-redux#1588,
I think following codes keep only files in docs/ directory and filter all files in versioned_docs.

https://github.com/facebook/docusaurus/compare/master...josephMG:fix/versioned_docs_relative_link?expand=1#diff-945e90ba000dd59353b89af45929efdeL70

    if (metadata.language !== 'en' || metadata.original_id) {
      return;
    }

After digging into these issues, I notice that metadata.source tracks versionFallback md file path, and htmlLink will be the url of fallback version. So I add a metadata.versioned_source means current version md file path, and htmlLink will be the url of current version.
https://github.com/facebook/docusaurus/compare/master...josephMG:fix/versioned_docs_relative_link?expand=1#diff-229712ff4ab11f33b4d6855bff2cc168L72

Test Plan

Fix Yarn test

Before: (See GIF or https://react-redux.js.org/)
versioned wrong link-1

versioned wrong link-2

After:
version correct-1

version correct-2

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot
Copy link
Contributor

Hi @josephMG!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit 04041d6

https://deploy-preview-3429--docusaurus-2.netlify.app

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 10, 2020
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@slorber slorber changed the title fix(v1) versioned_docs and skip-next-release relative path issue fix(v1): versioned_docs and skip-next-release relative path issue Sep 10, 2020
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Sep 10, 2020
@slorber
Copy link
Collaborator

slorber commented Sep 10, 2020

LGTM! thanks

@slorber slorber merged commit d280176 into facebook:master Sep 10, 2020
@josephMG josephMG deleted the fix/versioned_docs_relative_link branch September 10, 2020 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relative docs links are broken in "versioned" docs when building with "skip-next-release"
4 participants