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

URL alternative resolution criteria #2497

Merged
merged 8 commits into from
Sep 30, 2024
Merged

Conversation

taranvohra
Copy link
Member

@taranvohra taranvohra commented Sep 27, 2024

This PR changes the acceptance criteria of an alternative URL lookup. With the upcoming release of site URLs without /v/ we need to make sure that the lookup result we choose amongst a bunch of alternatives is the right one.

The criteria now is as follows:-

  • The alternative is the primary one. This is the easiest one to decide as it is the longest and most inclusive path so should always be considered.
  • The site content resolution resolved with a siteSpace that is different from the defaultSiteSpace. Again this also implies that we had the variant path in our alternative URL so consider this one too because it is the deepest one. Site URLs always end at the variant path after which we have the page paths.
    • company.gitbook.io/siteSlug/variantSlug/page
    • company.gitbook.io/siteSlug/shareKey/variantSlug/page
    • docs.company.com/variantSlug/page
    • docs.company.com/variantSlug/shareKey/page

Copy link

changeset-bot bot commented Sep 27, 2024

🦋 Changeset detected

Latest commit: fc7b546

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Minor

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

Copy link

argos-ci bot commented Sep 27, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 10 changed Sep 30, 2024, 8:38 AM

packages/gitbook/src/lib/api.ts Outdated Show resolved Hide resolved
@taranvohra taranvohra merged commit 1152445 into main Sep 30, 2024
9 checks passed
@taranvohra taranvohra deleted the alternative-resolution-criteria branch September 30, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants