Update umap/templates/umap/map_detail.html

Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
This commit is contained in:
Yohan Boniface 2024-10-10 10:43:54 +02:00 committed by Yohan Boniface
parent 97d2ebae34
commit 7aa445f01b
2 changed files with 7 additions and 3 deletions

View file

@ -18,7 +18,7 @@
{{ block.super }} {{ block.super }}
{% umap_js locale=locale %} {% umap_js locale=locale %}
{% if UMAP_DEMO_SITE or object.share_status != object.PUBLIC %} {% if UMAP_DEMO_SITE or object.share_status != object.PUBLIC %}
<meta name="robots" content="noindex"> <meta name="robots" content="noindex,nofollow">
{% endif %} {% endif %}
<link rel="alternate" <link rel="alternate"
type="application/json+oembed" type="application/json+oembed"

View file

@ -868,11 +868,15 @@ def test_non_public_map_should_have_noindex_meta(client, map, datalayer):
map.save() map.save()
response = client.get(map.get_absolute_url()) response = client.get(map.get_absolute_url())
assert response.status_code == 200 assert response.status_code == 200
assert '<meta name="robots" content="noindex">' in response.content.decode() assert (
'<meta name="robots" content="noindex,nofollow">' in response.content.decode()
)
def test_demo_instance_should_have_noindex(client, map, datalayer, settings): def test_demo_instance_should_have_noindex(client, map, datalayer, settings):
settings.UMAP_DEMO_SITE = True settings.UMAP_DEMO_SITE = True
response = client.get(map.get_absolute_url()) response = client.get(map.get_absolute_url())
assert response.status_code == 200 assert response.status_code == 200
assert '<meta name="robots" content="noindex">' in response.content.decode() assert (
'<meta name="robots" content="noindex,nofollow">' in response.content.decode()
)