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 an additional link tag with hreflang x-default to improve locale detection fallback #161

Closed
RomainGueffier opened this issue Mar 5, 2024 · 5 comments · Fixed by #162
Labels
enhancement New feature or request

Comments

@RomainGueffier
Copy link
Contributor

Hello, thank you for this really useful plugin !

Feature request

Summary

Add a link tag with hreflang="x-default"

Why is it needed?

Ahref SEO software rises advice to enable link tag with hreflang x-default value for default language fallback.
Google also mentions it: https://developers.google.com/search/blog/2023/05/x-default?hl=en

It is not necessary nor seems to penalise seo. But I would like to know your opinion on it?

Suggested solution(s)

Add the additional link tag with hreflang="x-default" value from default locale pathname.
I could contribute if needed 😃

@boazpoolman boazpoolman added the enhancement New feature or request label Mar 6, 2024
@boazpoolman
Copy link
Member

Hi @RomainGueffier

Thanks for submitting this feature request!
I think this can be a great addition to the plugin.

I'm wondering how much control the user needs for this value.
You're suggesting to have the hreflang="x-default" be the value from default locale pathname.
Though in the article I also read you might want to set it to be a language selection page.
Do you think this should be set globally (like the hostname), or should you be able to change the hreflang="x-default" per URL bundle?

@RomainGueffier
Copy link
Contributor Author

Glad you like the idea 🚀 ! I don't need the use case with a specific neutral page having language selector, but it should be done for sure.

I'm not sure how to make good UI/UX. As global option seems good to choose between:

  • disabled (default?)
  • a specific path
  • generate from default language pathname on every internationalised url bundles

No need for per-bundle settings if so.

What do you think?

@boazpoolman
Copy link
Member

Yep that sounds like a plan.

So that would be an extra select input (dropdown) in this section:
Scherm­afbeelding 2024-03-08 om 10 18 42

And the values of that select input can be:

  • Disabled
  • Default language pathname
  • Other

And when somebody selects the Other option an extra text input field should show in which the user can put the path of their choice.

And yeah just have disabled be the default makes sense. That would make this backwards compatible as well.

@RomainGueffier Do you want to make this contribution?

@RomainGueffier
Copy link
Contributor Author

RomainGueffier commented Mar 8, 2024

@boazpoolman deal! I will create PR soon. Do you have any default .vscode/settings.json or prettier config?

@boazpoolman
Copy link
Member

The repo has eslint configured for all linting and code formatting.
If you install the eslint plugin in vscode you should get highlighting on warning & errors :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants