jekyll-multiple-languages-plugin
jekyll-multiple-languages-plugin copied to clipboard
Feature request: automatical adding correct hreflang to the pages
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.
👍 Great idea!
Any dev picking this up, best reference here https://moz.com/learn/seo/hreflang-tag
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" />
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.