cnj-digital / seotamic

A Statamic v4 SEO addon
20 stars 13 forks source link

Hreflang takes the site handle, not the site name or language value #69

Closed mathamel closed 4 months ago

mathamel commented 4 months ago

The canonical language hreflang value uses the site handle, by default, Statamic name the first site 'default'. This is tricky to adjust afterwards or optimize, because it means renaming all content folders (or database handle)

` 'sites' => [

    'default' => [
        'name' => 'ACME USA',
        'locale' => 'en_US',
        'url' => '/en/',
    ],

    'fr' => [
        'name' => 'ACME CANADA',
        'locale' => 'fr_CA',
        'url' => '/fr/',
    ],

    'zh' => [
        'name' => 'ACME 中文',
        'locale' => 'zh-CN',
        'url' => '/zh/',
    ],

],`

It should use the locale, or have a configuration other site param to use.

<link rel="alternate" hreflang="default" href="https://mysiste.com/en" />

martink635 commented 4 months ago

You are correct, this is way better, will fix it in the next release!

Thanks