-
-
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
Can't remove deleted pages from search or "current" URL #2429
Comments
Unfortunately this is due to an oversight in the design of v1. See #2123 for more info. v2 uses a snapshotting approach which wouldn't have this problem. |
@yangshun I don't know how close v2 is to feature complete and how easy upgrading to it will be, but is there willingness to fix this in v1 using one of the approaches I suggest in "Possible Solutions" section above? For example, a list of deleted IDs ( |
@aldeed v2 is already used by a lot of people. Not so hard to upgrade. versioning is not 100% stable but still works quite nicely, i18n is not ready. if you submit a PR to v1 I could merge it. I'm not very familiar with v1 code to help you. A workaround could be to delete the pages that you don't want in the |
Thanks @slorber. There are no pages to delete. The problem is the fallback behavior so fixing it would involve deleting pages from previous versions, which is not what we want. We DO want the pages visible when viewing an old version (which has them in TOC) but we DO NOT want them visible when you search the current version or go directly to that ID URL in the current version. I'll see if I can figure out any easy way to circumvent the fallback from a list of IDs. EDIT: Nevermind, I think I see what you are saying. Delete all the files/folders after the last version in which the content was correct. That would work, but it's quite a lot to delete. Need to delete from every subsequent version plus the current. If I can figure out how to not generate those in the first place, that will be a much quicker build. |
🐛 Bug Report
Have you read the Contributing Guidelines on issues?
Yes, I highly recommend them
To Reproduce
cd website
yarn examples versions
yarn run version 1.0.0
docs/doc3.md
file and delete"Second Category": ["doc3"]
fromsidebars.json
yarn run version 2.0.0
yarn start
/docs/doc3
still resolves to the version 1.0.0 file in a browser even though it doesn't appear in the sidebar.Expected and Actual behavior
When I delete a markdown file from the main docs folder and remove it from the sidebar, I would expect it to be inaccessible from the "current" version.
But it continues to be returned by Algolia DocSearch, which can be clicked and the
/docs/<id>
does actually load correctly because of versioning fallback. This makes it appear as though that page still exists when it in fact does not.Possible Solutions
Maybe the version command should be creating an empty markdown file in a
versioned_docs
folder for every file that is no longer in/docs
?Or maybe it can be solved manually with an array of doc IDs that should no longer be accessible?
Or if there isn't a clear solution to the problem of the page being accessible, it should at least not appear in Algolia results so that nothing links to it.
Your Environment
Reproducible Demo
https://github.com/aldeed/docusaurus-versioning-issue
This repo followed the reproduction steps above so you only need to clone it,
yarn install
, and then start with theyarn start
step.The text was updated successfully, but these errors were encountered: