Merge pull request #2823 from kyoshino/bug-1140186-firefox-meta

Fix Bug 1140186 - Update meta tags on Firefox pages
This commit is contained in:
Alex Gibson 2015-03-18 18:40:15 +00:00
Родитель 181ea151fe 275c287876
Коммит e2a7657738
18 изменённых файлов: 98 добавлений и 18 удалений

Просмотреть файл

@ -23,10 +23,10 @@
<meta property="og:type" content="website">
<meta property="og:site_name" content="{{ _('Mozilla') }}">
<meta property="og:locale" content="{{ LANG|replace("-", "_") }}">
<meta property="og:url" content="{% block canonical_url %}{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}{% endblock %}">
<meta property="og:image" content="{% filter absolute_url %}{% block page_image %}{{ static('img/mozorg/mozilla-256.jpg') }}{% endblock %}{% endfilter %}">
<meta property="og:title" content="{{ self.page_title_full()|striptags }}">
<meta property="og:description" content="{{ self.page_desc()|striptags }}">
<meta property="og:url" content="{% filter trim|absolute_url %}{% block page_og_url %}{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}{% endblock %}{% endfilter %}">
<meta property="og:image" content="{% filter trim|absolute_url %}{% block page_image %}{{ static('img/mozorg/mozilla-256.jpg') }}{% endblock %}{% endfilter %}">
<meta property="og:title" content="{% filter striptags|e %}{% block page_og_title %}{{ self.page_title_full() }}{% endblock %}{% endfilter %}">
<meta property="og:description" content="{% filter striptags|e %}{% block page_og_desc %}{{ self.page_desc() }}{% endblock %}{% endfilter %}">
<meta property="fb:page_id" content="{% block facebook_id %}262134952380{# facebook.com/mozilla #}{% endblock %}">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@{% block twitter_id %}mozilla{% endblock %}">

Просмотреть файл

@ -22,10 +22,10 @@
<meta property="og:type" content="website">
<meta property="og:site_name" content="{{ _('Mozilla') }}">
<meta property="og:locale" content="{{ LANG|replace("-", "_") }}">
<meta property="og:url" content="{% block canonical_url %}{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}{% endblock %}">
<meta property="og:image" content="{% filter absolute_url %}{% block page_image %}{{ static('img/mozorg/mozilla-256.jpg') }}{% endblock %}{% endfilter %}">
<meta property="og:title" content="{{ self.page_title_full()|striptags }}">
<meta property="og:description" content="{{ self.page_desc()|striptags }}">
<meta property="og:url" content="{% filter trim|absolute_url %}{% block page_og_url %}{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}{% endblock %}{% endfilter %}">
<meta property="og:image" content="{% filter trim|absolute_url %}{% block page_image %}{{ static('img/mozorg/mozilla-256.jpg') }}{% endblock %}{% endfilter %}">
<meta property="og:title" content="{% filter striptags|e %}{% block page_og_title %}{{ self.page_title_full() }}{% endblock %}{% endfilter %}">
<meta property="og:description" content="{% filter striptags|e %}{% block page_og_desc %}{{ self.page_desc() }}{% endblock %}{% endfilter %}">
<meta property="fb:page_id" content="{% block facebook_id %}262134952380{# facebook.com/mozilla #}{% endblock %}">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@{% block twitter_id %}mozilla{% endblock %}">

Просмотреть файл

@ -13,7 +13,15 @@
{% elif channel == 'esr' %}
{{ _('Firefox ESR is intended for groups who deploy and maintain the desktop environment in large organizations. <a href="%s">Learn more.</a>')|format(url('firefox.organizations.organizations')) }}
{% else %}
{{ _('Firefox is available in more than 80 languages thanks to the contributions of Mozilla community members from around the world.') }}
{{ _('Firefox is made in large part by volunteers around the world. Thats why we offer it in 80 languages (and why theres heart and soul in every piece of code).') }}
{% endif %}
{% endblock %}
{% block page_image %}
{% if channel == 'aurora' %}
{{ static('img/firefox/developer/page-image.png') }}
{% else %}
{{ static('img/firefox/all/page-image.png') }}
{% endif %}
{% endblock %}

Просмотреть файл

@ -8,6 +8,19 @@
{% block extra_meta %}<meta name="robots" content="noindex">{% endblock %}
{#- This will appear as <meta property="og:title"> which can be used for social share -#}
{% block page_og_title %}
{{_('Choose the independent browser')}}
{% endblock %}
{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}
{{_('Firefox is non-profit, non-corporate, non-compromised. Choosing Firefox isnt just choosing a browser. Its a vote for personal freedom.')}}
{% endblock %}
{#- Override <meta property="og:url"> for social share -#}
{% block page_og_url %}{{ url('firefox') }}{% endblock %}
{% block body_class %}sky{% endblock %}
{% block site_css %}{% endblock %}

Просмотреть файл

@ -8,6 +8,19 @@
{% block extra_meta %}<meta name="robots" content="noindex">{% endblock %}
{#- This will appear as <meta property="og:title"> which can be used for social share -#}
{% block page_og_title %}
{{_('Choose the independent browser')}}
{% endblock %}
{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}
{{_('Firefox is non-profit, non-corporate, non-compromised. Choosing Firefox isnt just choosing a browser. Its a vote for personal freedom.')}}
{% endblock %}
{#- Override <meta property="og:url"> for social share -#}
{% block page_og_url %}{{ url('firefox') }}{% endblock %}
{% block body_class %}sky{% endblock %}
{% block site_css %}{% endblock %}

Просмотреть файл

@ -9,7 +9,7 @@
{% block body_class %}sky{% endblock %}
{% block page_title_prefix %}{{_('Mozilla Firefox Web Browser')}} — {% endblock %}
{% block page_image %}{{ static('img/firefox/firefox-256.jpg') }}{% endblock %}
{% block page_image %}{{ static('img/firefox/template/page-image.png') }}{% endblock %}
{% block page_favicon %}{{ static('img/firefox/favicon.ico') }}{% endblock %}
{% block page_favicon_large %}{{ static('img/firefox/favicon-196.png') }}{% endblock %}
{% block page_ios_icon %}{{ static('img/firefox/ios-icon-180.png') }}{% endblock %}

Просмотреть файл

@ -7,7 +7,7 @@
{% block body_class %}sky{% endblock %}
{% block page_title_prefix %}{{ _('Mozilla Firefox Web Browser') }} — {% endblock %}
{% block page_image %}{{ static('img/firefox/firefox-256.jpg') }}{% endblock %}
{% block page_image %}{{ static('img/firefox/template/page-image.png') }}{% endblock %}
{% block page_favicon %}{{ static('img/firefox/favicon.ico') }}{% endblock %}
{% block page_favicon_large %}{{ static('img/firefox/favicon-196.png') }}{% endblock %}
{% block page_ios_icon %}{{ static('img/firefox/ios-icon-180.png') }}{% endblock %}

Просмотреть файл

@ -15,6 +15,17 @@
{% block page_title_prefix %}{% endblock %}
{% block page_title %}{{_('Welcome to Firefox Developer Edition')}}{% endblock %}
{% block page_title_suffix %}{% endblock %}
{% block page_image %}{{ static('img/firefox/developer/page-image.png') }}{% endblock %}
{% block page_og_url %}{{ url('firefox.developer') }}{% endblock %}
{% block page_og_desc %}
{% if l10n_has_tag('meta_update_201503') %}
{{_('Built for those who build the Web. Introducing the only browser made for developers.')}}
{%- else -%}
{{ _('Introducing the only browser made for developers like you.') }}
{% endif %}
{% endblock %}
{% block body_id %}firefox-developer-firstrun{% endblock %}
{% block body_class %}blueprint{% endblock %}

Просмотреть файл

@ -6,7 +6,16 @@
{% block page_title_prefix %}{% endblock %}
{% block page_title %}{{_('Firefox Developer Edition')}}{% endblock %}
{% block page_desc %}{{_('Download Mozilla Firefox, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox today!')}}{% endblock %}
{% block page_image %}{{ static('img/firefox/developer/page-image.png') }}{% endblock %}
{% block page_desc %}
{% if l10n_has_tag('meta_update_201503') %}
{{_('Built for those who build the Web. Introducing the only browser made for developers.')}}
{%- else -%}
{{ _('Introducing the only browser made for developers like you.') }}
{% endif %}
{% endblock %}
{% block body_id %}firefox-developer{% endblock %}
{% block body_class %}blueprint{% endblock %}

Просмотреть файл

@ -14,7 +14,7 @@
<meta property="og:type" content="website">
<meta property="og:site_name" content="{{ _('Mozilla') }}">
<meta property="og:locale" content="{{ LANG|replace("-", "_") }}">
<meta property="og:url" content="{% block canonical_url %}{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}{% endblock %}">
<meta property="og:url" content="{% filter trim|absolute_url %}{% block page_og_url %}{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}{% endblock %}{% endfilter %}">
<meta property="og:image" content="{% filter absolute_url %}{% block page_image %}{{ static('img/firefox/independent/page-image.jpg') }}{% endblock %}{% endfilter %}">
<meta property="og:title" content="{{ self.page_title()|striptags }}">
<meta property="og:description" content="{{ self.page_desc()|striptags }}">

Просмотреть файл

@ -7,6 +7,17 @@
{% block page_title_prefix %}{{_('Download Firefox')}} — {% endblock %}
{% block page_title %}{{_('Free Web Browser')}}{% endblock %}
{% block page_desc %}{{_('Download Mozilla Firefox, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox today!')}}{% endblock %}
{#- This will appear as <meta property="og:title"> which can be used for social share -#}
{% block page_og_title %}
{{_('Choose the independent browser')}}
{% endblock %}
{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}
{{_('Firefox is non-profit, non-corporate, non-compromised. Choosing Firefox isnt just choosing a browser. Its a vote for personal freedom.')}}
{% endblock %}
{% block body_id %}firefox-new{% endblock %}
{#- Override the infobar options not to run the version check -#}

Просмотреть файл

@ -6,7 +6,7 @@
{% block page_title %}{{ _('Firefox OS, Marketplace, Android — Partners') }}{% endblock %}
{% block page_desc %}{{ _('Were enabling operators, phone manufacturers and developers to manage, customize and improve relationships with their customers directly through our mobile products: <a %(url1)s>Firefox OS</a>, <a %(url2)s>Firefox Marketplace</a> and <a %(url3)s>Firefox for Android</a>.') }}{% endblock %}
{% block page_image %}{{ static('img/firefox/firefox-256.jpg') }}{% endblock %}
{% block page_image %}{{ static('img/firefox/template/page-image.png') }}{% endblock %}
{% block page_favicon %}{{ static('img/firefox/favicon.ico') }}{% endblock %}
{% block page_favicon_large %}{{ static('img/firefox/favicon-196.png') }}{% endblock %}
{% block page_ios_icon %}{{ static('img/firefox/ios-icon-180.png') }}{% endblock %}

Просмотреть файл

@ -7,6 +7,9 @@
{% block page_title_prefix %}{% endblock %}
{% block page_title %}{{ _('Welcome to Firefox') }}{% endblock %}
{% block page_title_suffix %}{% endblock %}
{% block page_image %}{{ static('img/firefox/os/page-image.png') }}{% endblock %}
{% block page_og_url %}{{ url('firefox.os.index') }}{% endblock %}
{% block body_id %}firefox-whatsnew{% endblock %}
{% block site_header_nav %}{% endblock %}

Просмотреть файл

@ -462,8 +462,10 @@ def absolute_url(url):
if url.startswith('//'):
prefix = 'https:'
else:
elif url.startswith('/'):
prefix = settings.CANONICAL_URL
else:
prefix = ''
return prefix + url

Просмотреть файл

@ -13,7 +13,8 @@ from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
from rna.models import Release
from bedrock.mozorg.helpers.misc import convert_to_high_res, releasenotes_url
from bedrock.mozorg.helpers.misc import (convert_to_high_res, releasenotes_url,
absolute_url)
from bedrock.mozorg.tests import TestCase
@ -504,6 +505,7 @@ class TestAbsoluteURLFilter(TestCase):
rf = RequestFactory()
static_url_dev = '/static/'
static_url_prod = '//mozorg.cdn.mozilla.net/static/'
static_url_full = 'https://mozorg.cdn.mozilla.net/static/'
image_path = 'img/mozorg/mozilla-256.jpg'
inline_template = "{{ static('%s')|absolute_url }}" % image_path
block_template = ("{% filter absolute_url %}{% block page_image %}" +
@ -513,19 +515,27 @@ class TestAbsoluteURLFilter(TestCase):
return render(template, {'request': self.rf.get('/')})
@patch('django.contrib.staticfiles.storage.staticfiles_storage.base_url', static_url_dev)
def test_dev(self):
def test_image_dev(self):
"""Should return a fully qualified URL including a protocol"""
expected = settings.CANONICAL_URL + self.static_url_dev + self.image_path
eq_(self._render(self.inline_template), expected)
eq_(self._render(self.block_template), expected)
@patch('django.contrib.staticfiles.storage.staticfiles_storage.base_url', static_url_prod)
def test_prod(self):
def test_image_prod(self):
"""Should return a fully qualified URL including a protocol"""
expected = 'https:' + self.static_url_prod + self.image_path
eq_(self._render(self.inline_template), expected)
eq_(self._render(self.block_template), expected)
@override_settings(DEV=False)
def test_urls(self):
"""Should return a fully qualified URL including a protocol"""
expected = 'https://www.mozilla.org/en-US/firefox/new/'
eq_(absolute_url('/en-US/firefox/new/'), expected)
eq_(absolute_url('//www.mozilla.org/en-US/firefox/new/'), expected)
eq_(absolute_url('https://www.mozilla.org/en-US/firefox/new/'), expected)
class TestProductURL(TestCase):
rf = RequestFactory()

Двоичные данные
media/img/firefox/all/page-image.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 506 KiB

Двоичные данные
media/img/firefox/developer/page-image.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 278 KiB

Двоичные данные
media/img/firefox/template/page-image.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 383 KiB