-
Notifications
You must be signed in to change notification settings - Fork 264
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
Redirected pages show up without rendering in search #2457
Comments
This happens on latest but not on stable. Probably something that happened with the Sphinx 7 update |
In case it's hard to fix at build time: // Select the first element with the class 'search'
let searchElement = document.querySelector('.search');
// Get all the child elements, which are assumed to be 'li' elements
let children = Array.from(searchElement.children);
// Loop through the children and remove the ones containing '.html'
children.forEach(child => {
if (child.textContent.includes('.html')) {
child.remove();
}
}); |
It also only appears to happen on RTD, It doesn't appear to happen on a local build (local build doesn't render any results, but also doesn't have entries for the redirected pages) |
Test to see if this is a solution for wpilibsuite#2457
readthedocs can ignore files in search: https://docs.readthedocs.io/en/stable/config-file/v2.html#search-ignore #2467 is a proof of concept to show that it works. Rediraffe could generate that list |
It also doesn't happen on RTD PR builds, so it must be caused by something RTD does differently on PR builds vs regular builds |
It looks like search is different intentionally with the RTD builds https://docs.readthedocs.io/en/stable/guides/pull-requests.html#limitations |
https://docs.readthedocs.io/en/stable/server-side-search/index.html Looks like they have special search infra for main builds |
Screenshot from this search query for "test mode":
These two results are the same page: the first result is the real page, and the second is the redirect (both lead to the real page when clicked).
There definitely shouldn't be non-rendered results. Having two identical results would be confusing, so I'd expect redirects to not show up at all in search results.
The text was updated successfully, but these errors were encountered: