Conversation
🦋 Changeset detectedLatest commit: 4ee3ded The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
size-limit report 📦
|
|
Yeah good change I think. |
ArmandPhilippot
left a comment
There was a problem hiding this comment.
I'm certainly not as experimented as Joost, but as discussed in withastro/docs#13361 I think It's worth a try!
|
Explanation sounds reasonable, but I'm not familiar with this property fwiw. |
trueberryless
left a comment
There was a problem hiding this comment.
I mean the Google docs still state that x-default was designed for language select pages, but I'm in favour of trying it out.
Do you think adding some kind of comment in the code linking to the Google docs or stating that we want to try it out would make sense? I wouls just like to avoid leaving a head link in there in the long-term where we forgot why it was added in the first place... 🤔 So maybe linking to this PR would also make sense...

Description
<link rel="alternate" hreflang="x-default" href="...">meta tag to the existinghreflangalternates in multilingual sites.x-defaultsaying that “it was designed for language selector pages”.x-defaultmore liberally. Given his many years of SEO experience, I’m guessing that’s a sign this is a safe approach.Context
One reason for experimenting with this is to see if it helps with Starlight’s use of duplicate content. In multilingual Starlight sites that are not fully translated, the default language’s content gets reused to provide readers with something without leaving their locale. This leads to situations like
/en/content (but with German UI for navigation etc.)We’ve heard some reports that this reuse causes issues for search engines and can confuse them into using the non-default locale URL, so e.g. in this case a user searching in English gets suggested the
/de/URL.Factors:
<html lang="en/fr/de">to indicate localehreflangalternateslang="en"(or whatever the default locale is) attributeI’m curious to see if
x-defaulthelps at all here as a signal in these cases.The more extreme fix (and very likely to work) would be to use
canonicalto point back to the default locale for pages containing fallback content. However, this can have other unintended consequences. For example, site search indexers like Algolia skip indexing non-canonical pages by default, essentially removing this content if your language is not translated yet. So this change is an easier first step.