From e01d914dbd2688e759d90201c18365be967c64b3 Mon Sep 17 00:00:00 2001 From: James Knight Date: Mon, 6 Sep 2021 23:44:35 -0400 Subject: [PATCH] themes: use noscript for search js notification The "search.html" template will generate a warning admonition about requiring JavaScript for search and automatically hiding the element when supported. While functional, if a client renders the page slowly, the warning notification may be visible to the user for a moment. Instead of relying on JavaScript to suppress this warning, use a `noscript` tag to hide the warning for clients who do not support JavaScript. This also has the benefit of one less JavaScript call required by a client. Signed-off-by: James Knight --- sphinx/themes/basic/search.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html index e492b8d37..443a7e4fe 100644 --- a/sphinx/themes/basic/search.html +++ b/sphinx/themes/basic/search.html @@ -21,13 +21,14 @@ {% block body %}

{{ _('Search') }}

{% block scriptwarning %} -
- + {% endblock %} {% block searchtext %}