-
Notifications
You must be signed in to change notification settings - Fork 92
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
Search results shows up with Please activate JavaScript ... error #132
Comments
Not sure why you are seeing this. I don't see it. Which browser? Does the same happen when you use a private window (no extensions)? |
Its safari Version 16.2 (18614.3.7.1.5). Also it happens in private window. |
Do you see it here? https://www.statsmodels.org/stable/search.html?q=ARMAX |
No. Also it happens only in a specific repo and other repo is working fine. I checked the conf.py and version its the same. |
It does not happen in local but in gitlab pages |
I have also encountered this problem. After my testing, I found that the issue does not occur when using Sphinx version less than 6.0. Should sphinx-material consider compatibility with the new version of Sphinx🤣? |
yes, it got fixed after i downgraded to 5.3 |
This indeed looks like a bug in this theme, in combination with a newer Sphinx version. It's visible also in the docs of this theme itself, and it shows up when using support for multiple versions of the docs:
It indeed doesn't show up for |
The problematic fallback code lives here:
|
Looks like the issue is that Sphinx 5.0 and later no longer ship jQuery. Installing |
The issue can be fixed without adding a jQuery dependency by overriding your project's search page template. Here's one possible solution with a {%- extends "basic/search.html" %}
{% block body %}
<h1 id="search-documentation">{{ _('Search') }}</h1>
<noscript>
<div id="fallback" class="admonition warning">
<p>
{% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %}
</p>
</div>
</noscript>
{% if search_performed %}
<h2>{{ _('Search Results') }}</h2>
{% if not search_results %}
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
{% endif %}
{% endif %}
<div id="search-results">
{% if search_results %}
<ul>
{% for href, caption, context in search_results %}
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
<div class="context">{{ context|e }}</div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endblock %} (modified from https://github.com/bashtage/sphinx-material/blob/0d31923e0fb08e85027c3e7f03d12673209872e3/sphinx_material/sphinx_material/search.html) // that is, if you don't need the other place where jQuery is used AFAICS - version dropdown; could be replaced too I guess |
We have been facing issue with one of the repo where even if javascript is enabled it shows the warning as well as results.
Is this a known issue? If yes, what is is recommended fix? If not, then can any one suggest a fix.
The text was updated successfully, but these errors were encountered: