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
Gracefully disable search on file:// if Worker initialization fails #1520
Comments
Could you try to disable the search plugin? Add the following to
|
Thanks for your quick response! |
The problem manifests in v5 as the search worker script is initialized before the sidebars. Before it was the other way round so the JavaScript failed after sidebar initialization. On a general note, running this theme without a webserver may still exhibit some problems, but it is also not considered a very high priority. I'll try to provide a fix before the final release but can't say for sure. What you can do in the meantime is switch to the the localsearch plugin (note that you need to use the |
Ok, I guess I´ll wait a few more weeks as it´s not urgent for me. I actually used localsearch with 4.x without any problems, but also saw that @wilhelmer is working on an update of the plugin for v5. Thanks for the great work! |
Just released mkdocs-localsearch, version 0.6.0, with Material v5 support and installation instructions for Material v5 themes. Let me know if there are any issues. The |
Thanks for the clarification. From your docs:
I guess this should be |
True, copy/paste error from the v4 docs ;-) Will fix that. |
Thanks for the quick turnaround! However, I wasn´t successful yet. I installed your updated plugin and get the following error message: If I go back to 0.5.0 this error does not occur, but also I´m back to the previous state (i.e. search not working, side bars not fixed). I´m sure the error is on my side, but I think I´ve done everything as described. |
In plugins:
- search
- localsearch Sorry, my fault. I'll update the docs. |
Great, that did the trick. No more error messages and the the side bars stay in place :) Only the search function itself is not working for me now. (When I´ve started typing it still says "Type to start searching" and on Enter nothing happens). It doesn´t work neither with the local iframe-worker.js nor via the web link. edit: please ignore the above, I found that it was due to a leftover .html file in my partials/lanuguage folder. It´s working now, awesome! |
dac469e will now gracefully hide the search bar if:
Both are true when browsing locally. 1) can be mitigated by using the We can release this as part of the next release, and when I find some time I will refactor the workaround, but for now it should be fine. |
Released as part of 5.1.2 |
@squidfunk no idea if it is a regression, building with |
Thanks for reporting. Please open a new issue, if this turns out to be a problem. It would be perfect if you could try to find out which version introduced the problem, that would make fixing very quick and easy |
Sorry I could not bisect that. That's maybe not so much of a bad news, as it means that with many of the releases since then, I had no further problems. As said I'm plugging in So unless you (or anyone else) pokes me specifically about looking for where for this, I would continue in my own projects pace, but would be happy to dive into it deeper, again, in case this gets raised. Saying this, if there is traction for offline support in mkdocs usptream, also count on me for some legwork and support. But this needs decision in upstream.mkdocs (for me upstream is both mkdocs-material and mkdocs and I'm grateful how well both play together), and this is a bit off-topic here for this issue. So other users should feel free to comment here with the version they run into the issue as then this is a concrete problem for someone and we can capture it in a more structured fashion. As you write this is much easier. Currently "works on my machine" ;) |
@ktomk no worries, thanks for your offer to help! I think there's no need for action right now. |
I checked that...
Description
I was using v4.x without any of issues, but once I upgraded to v5 RCs (tried all 3) my navigation bars (both left and right) seem to not be fixed anymore, but rather move out of the frame when I scroll down. Please have a look at .gif attached.
One thing that might help understand the problem is that this issues only occurs when I run the built .html offline. When I use locolhost and "mkdocs serve", this behaviour does not occur.
Expected behavior
The navigation shall always be visible, as it was for me in v4.x.
Actual behavior
When I scroll down my page the navigation is not there anymore.
Steps to reproduce the bug
Package versions
Project configuration
System information
The text was updated successfully, but these errors were encountered: