Open Etua opened 7 years ago
👍 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.
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.