Commit 6a17be7d authored by Michal Čihař's avatar Michal Čihař

Provide consistent way for setting page description

Issue #976
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent ad20f88b
......@@ -13,9 +13,7 @@
<meta name="copyright" content="Copyright &copy; 2003 - {{ current_year }} Michal Čihař" />
<title>{% include "title.html" %}</title>
{% if description %}
<meta name="description" content="{{ description }}" />
{% endif %}
{% compress css %}
<link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap.css' %}" />
......@@ -53,11 +51,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:site_name" content="{% if site_title %}{{ site_title }}{% else %}Weblate{% endif %}" />
<meta property="og:title" content="{% if title %}{{ title }}{% else %}{% if object %}{{ object }}{% else %}{% if page_profile %}{{ page_profile.get_user_name }}{% else %}{% if site_title %}{{ site_title }}{% else %}Weblate{% endif %}{% endif %}{% endif %}{% endif %}" />
{% if offer_hosting %}
<meta property="og:description" content="{% trans "Hosted Weblate, the place to translate your software project." %}" />
{% else %}
<meta property="og:description" content="{% trans "This site runs Weblate for translating various software projects." %}" />
{% endif %}
<meta property="og:description" content="{{ description }}" />
{% block extra_meta %}
{% endblock %}
......
......@@ -20,6 +20,8 @@
from datetime import datetime
from django.utils.translation import ugettext as _
import weblate
from weblate import appsettings
from weblate.trans.site import get_site_url
......@@ -51,8 +53,18 @@ def weblate_context(request):
'subproject__project__name', 'subproject__name'
).select_related()
if appsettings.OFFER_HOSTING:
description = _(
'Hosted Weblate, the place to translate your software project.'
)
else:
description = _(
'This site runs Weblate for translating various software projects.'
)
return {
'version': weblate.VERSION,
'description': description,
'weblate_url': URL_BASE % weblate.VERSION,
'donate_url': URL_DONATE % weblate.VERSION,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment