breaking(v2): editUrl should point to website instead of docsDir #1958
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.
Motivation
In v1,
editUrl
is pointing todocsDir
and its always pointing tonext
for the edit.Try https://docusaurus.io/docs/en/1.13.0/installation, notice the edit is for
next
docs only.This breaking changes makes people moving docs folder around easier.
For example, if I renamed docs folder from
docs
todocument
. Before this PR i have to change the docs plugin path options fromdocs
todocument
AND I HAVE to update myeditUrl
from https://github.com/facebook/docusaurus/edit/master/website/docs/ to https://github.com/facebook/docusaurus/edit/master/website/document/ as well. Double work.After this PR, I only need to do it once
It supports versioned_docs and translated_docs editUrl better in future
Since we can always resolve it based from website dir. Since we already have lot of aliasing through
@site
, it makes more sense to point it towebsite
instead ofdocsDir
.Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
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.)