jungvonmatt / wekit

A Jamstack kit for Contentful, Hugo and Netlify.
https://www.wekit.dev
MIT License
14 stars 4 forks source link

Render same set of hreflang tags across languages #50

Open psolbach opened 1 year ago

psolbach commented 1 year ago

A recent Semrush report indicated that we should render the same set of hreflang tags across languages and include a reference to the current language version as well. This matches what Google writes in their documentation

So instead of this for e.g. foobar.com/en:

<link rel=alternate hreflang=x-default href=https://foobar.com/en>
<link rel=alternate hreflang=de href=https://foobar.com/de>

We want this:

<link rel=alternate hreflang=x-default href=https://foobar.com/en>
<link rel=alternate hreflang=en href=https://foobar.com/en>
<link rel=alternate hreflang=de href=https://foobar.com/de>