-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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(v1): add deletedDocs config to fix unwanted versioning fallback #2955
Conversation
Deploy preview for docusaurus-2 ready! Built with commit a41782b |
Thanks @aldeed that looks like a nice feature to fix the existing fallback issues of D1 we have for a long time. About using That would be nice if we were able to dogfood this feature by actually removing the fallback of some D1 website docs that are deprecated. I don't have enough history on D1 to have a doc that comes to mind but will try to find one. |
Unfortunately, I couldn't find any doc that seems removed between first/last version of D1 website 🤪 |
@slorber I had the same idea but also didn't see any removed docs files. I can change the Set to an array. Probably will convert to a Set when loading it, though, since that loop runs a lot and |
@slorber I updated this PR to accept an Array in the config. I do convert it to a Set before the versions loop to keep things speedy. Because the |
Hi, Using set is not a problem, but I think it's not very useful to document usage of set. People are fine with array and perf are good enough, it's a micro implementation detail that does not bring much value to document imho. I tried this on D1 website:
I deleted the "next" doc in So I guess it's supposed to fallback to the last found version 1.12. Yet, all those links still work: Is it working, or did I do something wrong? yarn start or yarn build, the doc is still there |
@slorber Version key must match |
Thanks, thats seems to work fine ;) |
released in https://github.com/facebook/docusaurus/releases/tag/v1.14.5 please let me know if this works, as it's my first v1 release 😅 |
@slorber I successfully configured this for a project using 1.14.6 release. Thanks! |
Motivation
Fixes an issue with v1 versioning fallback described in #2429 and #2123
This adds support for a
deletedDocs
option insiteConfig
, which allows you to mark article IDs as being deleted beginning with a certain version. This circumvents version fallback and also removes the article from the versionless/next URL.Example:
This is a backwards-compatible new feature for v1, but also essentially a "fix" for this issue that can be very serious when instructions that shouldn't be followed on later versions are still accessible in those versions.
Note that v2 uses a different approach to versioning that does not have this problem in the first place.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
yarn link
the v1 package into your projectdeletedDocs
option insiteConfig.js
for some docs that are in older versions but no longer relevant or linked from anywhere. Refer to example in the updated docs.