mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: make sure maps of demo instances of uMap are no indexed (#2203)
fix #2201
This commit is contained in:
commit
a2b8145cde
2 changed files with 21 additions and 2 deletions
|
@ -17,8 +17,8 @@
|
||||||
{% umap_css %}
|
{% umap_css %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
{% umap_js locale=locale %}
|
{% umap_js locale=locale %}
|
||||||
{% if 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"
|
||||||
|
|
|
@ -861,3 +861,22 @@ def test_ogp_links(client, map, datalayer):
|
||||||
assert f'<meta property="og:title" content="{map.name}" />' in content
|
assert f'<meta property="og:title" content="{map.name}" />' in content
|
||||||
assert f'<meta property="og:description" content="{map.description}" />' in content
|
assert f'<meta property="og:description" content="{map.description}" />' in content
|
||||||
assert '<meta property="og:site_name" content="uMap" />' in content
|
assert '<meta property="og:site_name" content="uMap" />' in content
|
||||||
|
|
||||||
|
|
||||||
|
def test_non_public_map_should_have_noindex_meta(client, map, datalayer):
|
||||||
|
map.share_status = Map.OPEN
|
||||||
|
map.save()
|
||||||
|
response = client.get(map.get_absolute_url())
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert (
|
||||||
|
'<meta name="robots" content="noindex,nofollow">' in response.content.decode()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_demo_instance_should_have_noindex(client, map, datalayer, settings):
|
||||||
|
settings.UMAP_DEMO_SITE = True
|
||||||
|
response = client.get(map.get_absolute_url())
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert (
|
||||||
|
'<meta name="robots" content="noindex,nofollow">' in response.content.decode()
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue