-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Migrate from Google search to MkDocs. #2849
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
Looks great! |
I've done a few updates so that the theme only loads the search index when the form is submitted. This is a bit nicer, as before it was loading 1.1mb of JSON on any page on load. (As a side, Docker ran into this problem with their Tipue search implementation, which I think makes it somewhat harder to solve.) Other than improvements in style, which I'm not great at, I can't think of anything else that needs to be done here. If anyone has time to test this out and give feedback I'd be grateful. Ideally it would be good to get feedback before I land the change in MkDocs. mkdocs/mkdocs#457 |
|
||
$('pre code').parent().addClass('prettyprint well'); | ||
|
||
$(document).on("submit", "#mkdocs_search_modal form", function (e) { | ||
$("#mkdocs-search-results").html("Searching...") |
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.
Need a ;
here.
@d0ugal I've been checking this out. Truly great and exciting work you've been pushing out with mkdocs! |
From my POV I'm happy with the screenshot & @jpadilla's review. |
Cool. Merged in MkDocs! I'll come back to this once we get closer to a release, I'm thinking it shouldn't be too long away. |
MkDocs 0.13 has now been released. I think this probably just needs some testing to check it all still works okay. I'll try and do this soon but initially focusing on upgrading ReadTheDocs which is stuck on MkDocs 0.11 (and is thus providing me with many confused users). |
Looking super lovely. ✨ |
This allows us to delete lots of code and avoid hard-coding the navigation. This does mean that {{ current_page }} isn't always available and needs to be conditionally used.
The {{ page_title }} and {{ site_name }} variables are now separated to add flexibility th themes.
This change updates the modal to use MkDocs for search.
This is optional, but will be required by MkDocs 1.0
I've rebased and updated this PR. As far as I can tell, it should be ready. My only concern would be cross browser support, I have only tested the latest FireFox and Chrome. |
Looks great - may as well merge this in now. |
Migrate from Google search to MkDocs.
To avoid loading the index on page load, I think it starts the download when you first search. So it might just be a delay as it downloads the JSON. I forget exactly how I set it up in the theme, I'll check. |
NOTE: This is dependant on MkDocs pull request 457.
Putting this up for review, but it is likely that it can't be merged for a while. All of these commits except the last are applicable to the latest MkDocs release (but there is a bug that needs a point release). I can break the cleanup commits at some point if it helps as they are not really related to search at all - sorry!
This is what the current work looks like at the moment.