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

Remove x-default tag #96

Open
tobimori opened this issue Jun 3, 2024 · 8 comments
Open

Remove x-default tag #96

tobimori opened this issue Jun 3, 2024 · 8 comments
Labels
type: bug 🐛 Is a bug; fixes a bug
Milestone

Comments

@tobimori
Copy link
Owner

tobimori commented Jun 3, 2024

  • Seems to be buggy right now
  • Is meant to provide a link to a fallback (with a language/country selector) - not the default language
@tobimori tobimori added the type: bug 🐛 Is a bug; fixes a bug label Jun 3, 2024
@delphinas
Copy link

Simple fix is this: 'href' => $this->page->url(kirby()->defaultLanguage()->code()) in meta.php

@wdebusschere
Copy link

wdebusschere commented Jun 5, 2024

@delphinas That is also how we do it, don't remove it.

@tobimori
Copy link
Owner Author

tobimori commented Jun 6, 2024

I'll have to dig deeper on what is the correct approach, but unfortunately don't have the time right now. Sorry.

@ovenum
Copy link

ovenum commented Oct 23, 2024

The href attribute for link tags with hreflang="x-default" should point to the same URL for every locale version of the page.

Maybe Kirbys link field can be used to pick the a page that should be used as default with a fallback to the default locale version of the page when not set.

@tobimori tobimori added this to the 2.0.0 milestone Oct 24, 2024
@ovenum
Copy link

ovenum commented Oct 25, 2024

I can’t judge how bad the problem is for Search Engine ranking. But tools like ahrefs.com will list it as an issue if x-default links do not point to the same Url for each language version.

Maybe a minor release is okay where the default locale Url is used for x-default href attribute? Like this the behaviour is correct. Creating a proper interface and/or option for it can still happen in 2.0.0?

Can create a PR if you want. Heres a preview of the change

@tobimori
Copy link
Owner Author

Maybe a minor release is okay where the default locale Url is used for x-default href attribute? Like this the behaviour is correct.

This was my intention behind the original inclusion of the x-default attribute.

However I'm not sure if this is actual the correct behaviour. As Google specifies it, it's meant to show a general language picker page, like this: https://www.apple.com/choose-country-region/

Most popular sites that have lots of language don't specify x-default for this reason. This is why I'd remove it, since a language picker page is not a default behaviour of Kirby. If you still want to apply this, you could use computed content in page models.

@ovenum
Copy link

ovenum commented Oct 25, 2024

However I'm not sure if this is actual the correct behaviour. As Google specifies it, it's meant to show a general language picker page, like this: https://www.apple.com/choose-country-region/

Not sure it always has to be a language neutral page, it can also be the language version of a page that is most appropriate for visitors whose locale does not mach any of the locales offert on a page.

https://developers.google.com/search/blog/2013/04/x-default-hreflang-for-international-pages

The new x-default hreflang attribute value signals to our algorithms that this page doesn't target any specific language or locale and is the default page when no other page is better suited. For example, it would be the page our algorithms try to show French-speaking searchers worldwide or English-speaking searchers on google.ca.

Looking at the example code from that link, it should be fine to point the default locale. Although this might not be what you want to do in every case. The information posted there is from 2013 though… so maybe this has changed in the past.

@leobardimpact
Copy link

In these Tell Google about localized versions of your page it says: "fallback page for unmatched languages, especially on language/country selectors or auto-redirecting home pages."

In multilanguage discussion, @bnomei mentiones to use use 'index' to get to the language-neutral auto-redirecting pages.

So I suggest to use:
$this->page->url('index')

This is included in #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

5 participants