Skip to content

Commit

Permalink
Don't index search results (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne authored Oct 31, 2023
1 parent 4fb0682 commit 01827d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/core/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
We don’t want older versions of the documentation to show up in search results.
So we block all non-latest pages indexing with the robots=noindex meta tag.
{% endcomment %}
{% if "latest" not in self.locale.language_code %}
{% if SEO_NOINDEX or "latest" not in self.locale.language_code %}
<meta name="robots" content="noindex">
{% endif %}

Expand Down
1 change: 1 addition & 0 deletions apps/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def search(request):
{
"search_query": search_query,
"search_results": search_results,
"SEO_NOINDEX": True,
},
)

Expand Down

0 comments on commit 01827d5

Please sign in to comment.