-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
use mkdocs builtin search.html #2289
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
Conversation
@@ -27,7 +27,9 @@ function init() { | |||
value: 'file' | |||
}).appendTo('#rtd-search-form'); | |||
|
|||
$("#rtd-search-form").prop("action", rtd.api_host + "/search/"); | |||
var search_url = window.location.protocol + "//" + window.location.hostname + | |||
"/" + rtd.language + "/" + rtd.version + "/search.html"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't respect subprojects and aliases. We can't assume the project path is https://hostname/language/version/search.html
, it could be https://hostname/projects/subproject/language/version/search.html
. Same for aliases here.
I'm generally -1 on supporting multiple search UX, and would rather see mkdocs indexing and search fixed using our existing search API. Will need a design decision here. |
MkDocs and Readthedocs don't currently agree on how to do search. This means that search has poor UX on the publically deployed docs on readthedocs.io. Here's a workaround suggested in github comments that we could use to fix things for us while we wait for the two projects to reconcile. See: readthedocs/readthedocs.org#2289 readthedocs/readthedocs.org#1088
MkDocs and Readthedocs don't currently agree on how to do search. This means that search has poor UX on the publically deployed docs on readthedocs.io. Here's a workaround suggested in github comments that we could use to fix things for us while we wait for the two projects to reconcile. See: readthedocs/readthedocs.org#2289 readthedocs/readthedocs.org#1088
Closing this, as I don't believe it's currently the solution to the problem of making search better. |
Currently, mkdocs projects have a search-box action of
https://readthedocs.org/search/
, which has been reported as inoperative in #1088 (and others). This PR changes this action to use the mkdocs builtinsearch.html
page.Also, in the process of making this patch, I found that mkdocs doesn't expose the
mkdocs_page_input_path
variable on non-content-bearing pages (such assearch.html
). Thus, I have placed a guard around it, to prevent it fromReferenceError
ing while searching.