Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions springfield/base/templates/includes/canonical-url.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% if CANONICAL_LANG != LANG or do_not_index or (page is defined and page.noindex) %}
<meta name="robots" content="noindex,follow">
{% endif %}
{% if is_homepage %}<link rel="alternate" hreflang="x-default" href="{{ settings.CANONICAL_URL }}{{ canonical_path }}">{% endif %}
<link rel="alternate" hreflang="x-default" href="{{ settings.CANONICAL_URL }}{{ canonical_path }}">
{% if available_languages -%}
{%- for code, label in available_languages|dictsort -%}
{#- Skip alias locales that don't have their own content -#}
Expand All @@ -26,7 +26,6 @@
{%- set loop_canonical_path = canonical_path -%}
{%- endif -%}
{%- if code == 'en-US' -%}
<link rel="alternate" hreflang="en" href="{{ settings.CANONICAL_URL + '/' + code + loop_canonical_path }}" title="English">
<link rel="alternate" hreflang="en-US" href="{{ settings.CANONICAL_URL + '/' + code + loop_canonical_path }}" title="English (USA)">
{% elif code == 'es-ES' -%}
<link rel="alternate" hreflang="es" href="{{ settings.CANONICAL_URL + '/' + code + loop_canonical_path }}" title="Español">
Expand Down
4 changes: 3 additions & 1 deletion springfield/cms/templates/cms/base-flare26.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!doctype html>
<html
class="windows no-js"
lang="{{ LANG|replace('en-US', 'en') }}"
lang="{{ LANG }}"
dir="{{ DIR }}"
data-country-code="{{ country_code }}"
data-needs-consent="{{ needs_data_consent(country_code) }}"
Expand Down Expand Up @@ -50,6 +50,8 @@
<meta property="og:locale" content="{{ LANG|replace("-", "_") }}">
<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 %}{% if page and page.og_image %}{% set img = image(page.og_image, "width-1200") %}{{ img.url }}{% else %}{{ static('img/firefox/flare/og.png') }}{% endif %}{% endblock %}{% endfilter %}">
<meta property="og:image:width" content="{% block page_image_width %}{% if page and page.og_image %}{% set img = image(page.og_image, "width-1200") %}{{ img.width }}{% else %}1200{% endif %}{% endblock %}">
<meta property="og:image:height" content="{% block page_image_height %}{% if page and page.og_image %}{% set img = image(page.og_image, "width-1200") %}{{ img.height }}{% else %}630{% endif %}{% endblock %}">
Comment on lines 51 to +54
<meta property="og:title" content="{% filter striptags %}{% block page_og_title %}{{ (page.og_title or page.title) if page is defined and page.title is defined else 'Firefox' }}{% endblock %}{% endfilter %}">
<meta property="og:description" content="{% filter striptags %}{% block page_og_desc %}{{ page.og_description if page is defined and page.og_description is defined }}{% endblock %}{% endfilter %}">
<meta property="fb:page_id" content="{% block facebook_id %}14696440021{# facebook.com/firefox #}{% endblock %}">
Expand Down
4 changes: 2 additions & 2 deletions springfield/cms/tests/test_locale_fallback_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ def test_non_cms_page_hreflang_alternates(client):
# Canonical should be self-referencing (en-US).
assert f'rel="canonical" href="{settings.CANONICAL_URL}/en-US{page_path}"' in html
assert '<meta name="robots" content="noindex,follow">' not in html
# en-US should emit both hreflang="en" and hreflang="en-US".
assert f'hreflang="en" href="{settings.CANONICAL_URL}/en-US{page_path}"' in html
# en-US should emit hreflang="en-US" only (duplicate bare hreflang="en" was removed for SEO clarity).
assert f'hreflang="en" href="{settings.CANONICAL_URL}/en-US{page_path}"' not in html
assert f'hreflang="en-US" href="{settings.CANONICAL_URL}/en-US{page_path}"' in html
Comment on lines 479 to 483
# Locales in active_locales should appear.
assert f'hreflang="fr" href="{settings.CANONICAL_URL}/fr{page_path}"' in html
Expand Down
Loading