mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add 'noindex' meta robots tag to the search results page (#11700)
This commit is contained in:
parent
5d58624227
commit
71d3eaee75
@ -34,6 +34,8 @@ Bugs fixed
|
||||
* #11483: singlehtml builder: Fix MathJax lazy loading when the index does not
|
||||
contain any math equations.
|
||||
Patch by Bénédikt Tran.
|
||||
* #11697: HTML Search: add 'noindex' meta robots tag.
|
||||
Patch by James Addison.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
@ -15,8 +15,9 @@
|
||||
<script src="{{ pathto('_static/language_data.js', 1) }}"></script>
|
||||
{%- endblock %}
|
||||
{% block extrahead %}
|
||||
<script src="{{ pathto('searchindex.js', 1) }}" defer></script>
|
||||
{{ super() }}
|
||||
<script src="{{ pathto('searchindex.js', 1) }}" defer></script>
|
||||
<meta name="robots" content="noindex" />
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<h1 id="search-documentation">{{ _('Search') }}</h1>
|
||||
|
@ -399,6 +399,9 @@ def test_html4_error(make_app, tmp_path):
|
||||
(".//h1", "Generated section"),
|
||||
(".//a[@href='_sources/otherext.foo.txt']", ''),
|
||||
],
|
||||
'search.html': [
|
||||
(".//meta[@name='robots'][@content='noindex']", ''),
|
||||
],
|
||||
}))
|
||||
@pytest.mark.sphinx('html', tags=['testtag'],
|
||||
confoverrides={'html_context.hckey_co': 'hcval_co'})
|
||||
|
Loading…
Reference in New Issue
Block a user