aerni / statamic-advanced-seo

Comprehensive SEO addon for Statamic with flexibility in mind
https://statamic.com/addons/aerni/advanced-seo
11 stars 6 forks source link

hreflang with only country? #132

Closed JorisOrangeStudio closed 5 months ago

JorisOrangeStudio commented 7 months ago

Hi, Is it possible to have the hreflang rendered only with the country code? Now the output is like this:

<link rel="alternate" href="http://localhost" hreflang="nl-NL">
<link rel="alternate" href="http://localhost/en" hreflang="en-US">

But we want this to be (to include also other countries with the same languages):

<link rel="alternate" href="http://localhost" hreflang="nl">
<link rel="alternate" href="http://localhost/en" hreflang="en">

And the possibility to add the x-default hreflang <link rel="alternate" href="http://localhost" hreflang="x-default" />

aerni commented 7 months ago

The hreflang will be the whatever you define as the locale in your sites.php. So you can just change it there from nl_NL to nl and en_US to en.

If you can't do that, you can always publish the Advanced SEO views and modify the hreflang there using Antlers.

Adding x-default is on my list of features.

aerni commented 3 months ago

Just letting you know that support for x-default has been added in https://github.com/aerni/statamic-advanced-seo/pull/156.