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

fix(theme-common): isSamePath should be case-insensitive #6758

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Feb 25, 2022

Motivation

Sometimes the user has a filename like Capitalized.md leading to a slug with some uppercase chars such as /docs/Capitalized

But this URL is often normalized to /docs/capitalized by CDN/hosts and then when we try to match the 2 paths we consider they are different.

This leads to subtle UX issues such as:

  • empty breadcrumb
  • bad navbar item highlighting
  • bad sidebar category/items highlighting

The helper function isSamePath should be case-insensitive to fix it.

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

tests + dogfood

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Feb 25, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 25, 2022
@netlify
Copy link

netlify bot commented Feb 25, 2022

✔️ [V2]

🔨 Explore the source changes: ece6ea2

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6218dd4278415a00084e488f

😎 Browse the preview: https://deploy-preview-6758--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 47
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-6758--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: +669 B (0%)

Total Size: 783 kB

Filename Size Change
website/.docusaurus/globalData.json 48.3 kB +174 B (0%)
website/build/assets/js/main.********.js 592 kB +495 B (0%)
ℹ️ View Unchanged
Filename Size
website/build/assets/css/styles.********.css 106 kB
website/build/index.html 37.6 kB

compressed-size-action

@slorber slorber merged commit 44a65f3 into main Feb 25, 2022
@slorber slorber deleted the slorber/fix-isSamePath branch February 25, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants