Skip to content

Commit

Permalink
prevent non-production deployments from being indexed by search engines
Browse files Browse the repository at this point in the history
  • Loading branch information
jarosenb committed Feb 13, 2024
1 parent 8a539ab commit 16aea95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions designsafe/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def debug(request):
context['debug'] = True
if settings.RENDER_REACT:
context['react_flag'] = True
context['ds_environment'] = settings.DESIGNSAFE_ENVIRONMENT
return context

def site_verification(request):
Expand Down
3 changes: 3 additions & 0 deletions designsafe/templates/base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<title>{% block title %}{% page_attribute "page_title" %}{% endblock %} | DesignSafe-CI</title>
<meta name="viewport" content="width=device-width">
<meta name="description" content="{{description}}">
{% if ds_environment != 'default' %}
<meta name="robots" content="noindex">
{% endif %}

<link rel="icon" href="{% static 'favicon.ico' %}">
{% if 'designsafe.storage.published' in request.get_full_path %}
Expand Down

0 comments on commit 16aea95

Please sign in to comment.