Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default locale as hreflang when using alternate option #270

Closed
taylankasap opened this issue Feb 22, 2021 · 2 comments · Fixed by #271
Closed

Add default locale as hreflang when using alternate option #270

taylankasap opened this issue Feb 22, 2021 · 2 comments · Fixed by #271

Comments

@taylankasap
Copy link
Contributor

This code should be removed:

if ($alternate === $locale) {
continue; // avoid re-adding default route
}

Reason

Both from Google docs:

Each element must have a child element <xhtml:link rel="alternate" hreflang="supported_language-code"> that lists every alternate version of the page, including itself.

Each language version must list itself as well as all other language versions.

I can open PR if that's okay.

@yann-eugone
Copy link
Member

Hu @taylankasap :)

Thank you for reporting this enhancement.
Looks like you are right, regarding the doc you provided.

A PR would be nice. Will you be OK to add some tests too ?

@yann-eugone
Copy link
Member

Released as of v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants