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-classic): fix breadcrumb home link bug with new useHomePageRoute() hook #6749

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Feb 23, 2022

Motivation

See also #6517 (comment)

Breadcrumbs link to the home by default:

image

Sometimes a site does not have a homepage, so it's not possible to link by default to / from the breadcrumbs home icon (lead to broken links error).

In such cases we can simply remove the home item from breadcrumbs, until we find a better solution (see suggestions in #6517 (comment))

image

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

unit tests + local tests without home page or with docs/blog-only-home

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

netlify bot commented Feb 23, 2022

✔️ [V2]

🔨 Explore the source changes: 64579f7

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

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

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 57
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

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

@github-actions
Copy link

Size Change: +358 B (0%)

Total Size: 782 kB

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

compressed-size-action

@slorber slorber merged commit ece7399 into main Feb 24, 2022
@slorber slorber deleted the slorber/fix-breadcrumbs-home-link branch February 24, 2022 10:27
@PatelN123
Copy link
Contributor

@slorber Might be a dumb idea, but how about instead of removing it fully, giving the user an option to set a home URL? Maybe in the config file...

@slorber
Copy link
Collaborator Author

slorber commented Feb 24, 2022

That is an idea, but IMHO it's better if sites have a homepage so maybe we should encourage to have one instead?

We have other places where we link to this homepage, including the navbar logo:

const logoLink = useBaseUrl(logo.href || '/');

@PatelN123
Copy link
Contributor

That's a point.
I just thought with the scenario we had with the Chatwoot docs, it may be a neat idea.

@pranabdas
Copy link
Contributor

@slorber what about sites with baseUrl? In beta 16, the home icon is not shown in the breadcrumbs in this case. I suppose it should be there linking to /baseUrl/ 🤔

@slorber
Copy link
Collaborator Author

slorber commented Feb 28, 2022

@pranabdas you are right it's a silly mistake 😅 will fix it on Wednesday unless someone wants to handle it before

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.

4 participants