Skip to content

Commit

Permalink
Add english language code to the x-default link attribute (#12479)
Browse files Browse the repository at this point in the history
* Add english language code to the `x-default` link attribute

* Fixed quotes on template tag context variable

* Fix indentation to pass lint build step in pipeline
  • Loading branch information
ramram-mf authored Jun 13, 2024
1 parent aeaa4b9 commit d066a7c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
{% get_available_languages as LANGUAGES %}

<link rel="canonical" href="{{ CANONICAL_SITE_URL }}/{{ LANGUAGE_CODE }}{{ CANONICAL_PATH }}">
<link rel="alternate" hreflang="x-default" href="{{ CANONICAL_SITE_URL }}{{ CANONICAL_PATH }}">

{% with "en" as ENGLISH_LANG_CODE %}
<link rel="alternate" hreflang="x-default" href="{{ CANONICAL_SITE_URL }}/{{ ENGLISH_LANG_CODE }}{{ CANONICAL_PATH }}">
{% endwith %}

{% for CODE, NAME in LANGUAGES %}
{% get_language_info for CODE as lang %}
{% if CODE == 'es' %}
Expand Down

0 comments on commit d066a7c

Please sign in to comment.