jekyll-multiple-languages-plugin icon indicating copy to clipboard operation
jekyll-multiple-languages-plugin copied to clipboard

Feature request: automatical adding correct hreflang to the pages

Open Etua opened this issue 8 years ago • 3 comments

hreflang is used by search engines to define language of the particular site, so adding it to every generated page will improve it's SEO.

Etua avatar May 29 '17 20:05 Etua

👍 Great idea!

Any dev picking this up, best reference here https://moz.com/learn/seo/hreflang-tag

MPJHorner avatar Jan 19 '18 11:01 MPJHorner

Why not just put this into the <head>?

{% capture link1 %}{{ site.baseurl_root }}{{ page.url}}{% endcapture %}
<link rel="alternate" href="{{ link1 }}" hreflang="en-us" />
{% capture link2 %}{{ site.baseurl_root }}pl{{ page.url  }}{% endcapture %}
<link rel="alternate" href="{{ link2 }}" hreflang="pl-pl" />

bbbenji avatar Nov 20 '18 09:11 bbbenji

The solution provided by @bbbenji is probably okay, but the best solution would be to iterate through config's languages rather than hardcode languages into templates.

Nowaker avatar Jul 15 '19 21:07 Nowaker