-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
feat(v2): new docs edit options: editCurrentVersion + editLocalizedDocs #3949
Conversation
@Simek I think you wanted this for RN website |
Size Change: +9 B (0%) Total Size: 155 kB ℹ️ View Unchanged
|
✔️ Deploy preview for docusaurus-2 ready! 🔨 Explore the source changes: aac4692 🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/5fe238cce23b300007e2feff 😎 Browse the preview: https://deploy-preview-3949--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-3949--docusaurus-2.netlify.app/classic/ |
Motivation
editCurrentVersion: true
With Docusaurus v1, even with versioning enabled, the edit button always targeted the "upstream" docs (ie the ./docs folder), not the versioned folders.
With Docusaurus v2, this behavior has changed, and this can be annoying because users end up submitting docs pull requests to the "last version" (the version of your last release), so you end up merging doc updates for a specific version, but lose those edits in the upstream version.
editCurrentVersion: true
will restore the v1 behavioreditLocalizedDocs: true
Also, for i18n support, you may want the edit button to target either the original untranslated doc, or the localized doc. It does not make sense to always target the localized doc, and really depends on the usecase: