-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-theme-notes] breadcrumb home icon is linking to “/“ instead of basePath. #15494
Comments
@gatsbyjs/themes-core, what does everyone think about this? I am kinda leaning to have the default be mapped to the root of the notes instead of the root of the site always. And if someone wants to make a link in the notes index to go up to the homepage of their site if the two are not the same, it could be easily shadowed to do such. It's the thing that I think in cases like this, navigation for the notes theme should be encapsulated and not exit the theme's context by default |
Agreed, this should definitely link to the notes theme |
@lannonbr my thoughts exactly. By linking to the root of notes, instead of the root of the site, |
Alright. So I would say then feel free to push a PR up for this @jakewies. In the BreadcrumbHome component, you should be able to use the use-options.js hook to get the basePath and then plop it in to the the link. |
Awesome! I'll get on it 👍 I have been struggling to test changes made in the I brought this up to @johno in that issue. It would be super helpful to get some guidance on this, as the attempts I've made to test changes in that directory haven't worked. You can check out more info on the issue here, but the gist of it is that running a theme-starter in |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
@johno I'll make a PR for this now that I have the ability to see changes to themes in development. |
I just pushed a commit in #16564 to fix this issue, and it works as intended. But something else came to mind. If I, a user of // gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-theme-notes`,
options: {
basePath: `/notes`,
},
},
],
} Then the constructed breadcrumb will look like this:
The problem with this is that now you have a home breadcrumb
Where only 1 breadcrumb represents the base path, the home breadcrumb What do you all think? EDIT: This would probably make #16556 unnecessary? |
Description
The root breadcrumb, specified in the
gatsby-theme-notes
options section ashomeText
, is always linking to“/“
, even when a user passes a custombasePath
Steps to reproduce
gatsby-theme-notes
:gatsby-config.js
, pass a custombasePath
value to theoptions
property:Run
yarn develop
Navigate to
localhost:8000/notes/example-dir
.Expected result
When clicking the root breadcrumb icon,
~
, I should be re-directed back to the notesbasePath
, i.e.localhost:8000/notes
.Actual result
I am re-directed to
/
, i.e.localhost:8000
.Environment
I’ve tracked the issue to the
BreadcrumbHome
component. It is hard-coding/
as the value of theLink
component’sto
prop. A simple fix would be to pass this component thebasePath
as a prop.Again, this may be the intended behavior, but in my brain it seems that the root breadcrumb should always go back to the root of the notes section. I’d be happy to submit a PR if this should be the case. 😄
The text was updated successfully, but these errors were encountered: