Fix <link rel=alternative> URLs

This commit is contained in:
rubenwardy 2022-06-07 18:14:53 +01:00
parent 7e12752e12
commit 770a6f4e2e

View File

@ -28,7 +28,8 @@ layout: compress
{% unless other_lang.code == language %}
{% assign newSegment = "/" | append: other_lang.code | append: "/" %}
<link rel="alternate" hreflang="{{ other_lang.code }}" href="{{ page.url | replace: oldSegment, newSegment }}" />
<link rel="alternate" hreflang="{{ other_lang.code }}"
href="{{ page.url | replace: oldSegment, newSegment | relative_url }}" />
{% endunless %}
{% endfor %}