Skip to content

Commit b60604b

Browse files
committed
Update head.html
referring to the [Google Search Central official documentation](https://developers.google.com/search/docs/specialty/international/localized-versions#xdefault), I specified `x-default` instead of `site.default_lang` as the hreflang attribute value for the site's default language page, so that the link to that page is recognized as a fallback when the visitor's preferred language is not in the list of languages supported by the site or when the visitor's preferred language cannot be recognized.
1 parent 6583bf1 commit b60604b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<meta http-equiv="Content-Language" content="{{site.active_lang}}">
1313

14-
<link rel="alternate" hreflang="{{site.default_lang}}" href="{{site.url}}{{page.url}}" />
14+
{% if site.default_lang %}<link rel="alternate" hreflang="x-default" href="{{site.url}}{{page.url}}" />{% endif %}
1515
{% for lang in site.languages %}{% if lang == site.default_lang %}{% continue %}{% endif %}
1616
<link rel="alternate" hreflang="{{lang}}" href="{{site.url}}/{{lang}}{{page.url}}" />
1717
{% endfor %}

0 commit comments

Comments
 (0)