{% extends "base.html" %}

{% load i18n future mezzanine_tags %}

{% block meta_title %}{% trans "Search Results" %}{% endblock %}
{% block title %}{% trans "Search Results" %}{% endblock %}

{% block breadcrumb_menu %}
<li>
    <a href="{% url "home" %}">{% trans "Home" %}</a>
</li>
<li class="active">{% trans "Search Results" %}</li>
{% endblock %}

{% block main %}

{% if results.paginator.count == 0 %}
<p>
{% blocktrans %}
No results were found in {{ search_type }} matching your query: {{ query }}
{% endblocktrans %}
{% else %}
{% blocktrans with start=results.start_index end=results.end_index total=results.paginator.count %}
Showing {{ start }} to {{ end }} of {{ total }} results in {{ search_type }} matching your query: {{ query }}
{% endblocktrans %}
{% endif %}
</p>

<div id="search-results">
    {% for result in results.object_list %}
    <h5>{{ forloop.counter0|add:results.start_index }})
        <a href="{{ result.get_absolute_url }}">{{ result }}</a></h5>
    <p>{{ result.description|truncatewords_html:20|safe }}</p>
    <a href="{{ result.get_absolute_url }}">{% trans "read more" %}</a>
    {% endfor %}
</div>

{% pagination_for results %}

{% endblock %}

{% extends "base.html" %}

{% load i18n future mezzanine_tags %}

{% block meta_title %}{% trans "Search Results" %}{% endblock %}
{% block title %}{% trans "Search Results" %}{% endblock %}
{% block extra_head %}
<meta name="robots" content="noindex">
{% endblock %}

{% block breadcrumb_menu %}
<li>
    <a href="{% url "home" %}">{% trans "Home" %}</a>
</li>
<li class="active">{% trans "Search Results" %}</li>
{% endblock %}

{% block main %}

{% if results.paginator.count == 0 %}
<p>
{% blocktrans %}
No results were found in {{ search_type }} matching your query: {{ query }}
{% endblocktrans %}
{% else %}
{% blocktrans with start=results.start_index end=results.end_index total=results.paginator.count %}
Showing {{ start }} to {{ end }} of {{ total }} results in {{ search_type }} matching your query: {{ query }}
{% endblocktrans %}
{% endif %}
</p>

<div id="search-results">
    {% for result in results.object_list %}
    <h5>{{ forloop.counter0|add:results.start_index }})
        <a href="{{ result.get_absolute_url }}">{{ result }}</a></h5>
    <p>{{ result.description|truncatewords_html:20|safe }}</p>
    <a href="{{ result.get_absolute_url }}">{% trans "read more" %}</a>
    {% endfor %}
</div>

{% pagination_for results %}

{% endblock %}

Add noindex tag to search results
Add noindex tag to search results

Search results shouldn't normally be indexed, given that they can be generated for arbitrary queries. This patch adds a noindex tag to the head.