meta tags: Use open graph titles/descriptions.

Apparently, we were incorrectly using constants for title/description
rather than the nice non-constant values from og:title and
og:description in our meta tags.
This commit is contained in:
Tim Abbott 2020-08-14 10:51:11 -07:00
parent cc93044cd1
commit b494b16791
3 changed files with 14 additions and 5 deletions

View File

@ -8,9 +8,13 @@
{% block title %} {% block title %}
{% if user_profile and user_profile.realm.name %} {% if user_profile and user_profile.realm.name %}
<title>{{user_profile.realm.name}} - Zulip</title> <title>{{user_profile.realm.name}} - Zulip</title>
{% else %}
{% if OPEN_GRAPH_TITLE %}
<title>{{ OPEN_GRAPH_TITLE }}</title>
{% else %} {% else %}
<title>Zulip</title> <title>Zulip</title>
{% endif %} {% endif %}
{% endif %}
{% endblock %} {% endblock %}
<link id="favicon" rel="icon" href="/static/images/favicon.svg?v=4"> <link id="favicon" rel="icon" href="/static/images/favicon.svg?v=4">
<link rel="alternate icon" href="/static/images/favicon.png?v=4"> <link rel="alternate icon" href="/static/images/favicon.png?v=4">

View File

@ -1,6 +1,10 @@
<!-- Google / Search Engine Tags --> <!-- Google / Search Engine Tags -->
{% if allow_search_engine_indexing %} {% if allow_search_engine_indexing %}
{% if OPEN_GRAPH_DESCRIPTION %}
<meta name="description" content="{{ OPEN_GRAPH_DESCRIPTION }}">
{% else %}
<meta name="description" content="Zulip combines the immediacy of real-time chat with an email threading model. With Zulip, you can catch up on important conversations while ignoring irrelevant ones."> <meta name="description" content="Zulip combines the immediacy of real-time chat with an email threading model. With Zulip, you can catch up on important conversations while ignoring irrelevant ones.">
{% endif %}
{% else %} {% else %}
<meta name="robots" content="noindex,nofollow"> <meta name="robots" content="noindex,nofollow">
{% endif %} {% endif %}

View File

@ -75,7 +75,8 @@ class DocPageTest(ZulipTestCase):
for s in landing_missing_strings: for s in landing_missing_strings:
self.assertNotIn(s, str(result.content)) self.assertNotIn(s, str(result.content))
if not doc_html_str: if not doc_html_str:
self.assert_in_success_response(['<meta name="description" content="Zulip combines'], result) # Every page has a meta-description
self.assert_in_success_response(['<meta name="description" content="'], result)
self.assert_not_in_success_response(['<meta name="robots" content="noindex,nofollow">'], result) self.assert_not_in_success_response(['<meta name="robots" content="noindex,nofollow">'], result)
# Test the URL on the "zephyr" subdomain with the landing page setting # Test the URL on the "zephyr" subdomain with the landing page setting