Closed ashu-shukla closed 1 month ago
Hi, sorry for packing so much info๐ . I noticed the help-wanted flag... do I raise a PR so it would be easier to see the changes? Or this is not needed?
Hi, i having the same problem, but i need replace text.
so add replaceLinkTextArray use replaceLinkText solving the problem.
With the latest beta release you can control every crumb attribute (incl. text).
If you like to modify the last crumb:
---
const customLastPart = [{ index: "last", text: "Last page!", "data-any-attribute": "any" }];
---
<Breadcrumbs
customizeLinks={customLastPart}
debug={true}>
</Breadcrumbs>
To modify any other part of your breadcrumbs, create an object for each.
---
const modifyParts = [
{
"data-link": "home",
"aria-label": "Go to the home page",
text: "Page 1",
},
{
"data-link": "about",
"aria-label": "Go to the about page",
text: "Page 2",
},
{ "is-last": true, text: "Last page!" },
{
"data-link": "contact",
"aria-label": "Go to the contact page",
text: "Page 3",
},
];
---
<Breadcrumbs
customizeLinks={modifyParts }
debug={true}>
</Breadcrumbs>
[!TIP] use prop
debug={true}
to see merge changes
Hi, sorry for packing so much info๐ . I noticed the help-wanted flag... do I raise a PR so it would be easier to see the changes? Or this is not needed?
Hey, I've seen your PR, as well as the one from @codeinfo. I've decided to solve the whole thing another way.
Both of your requirements have finally brought me to the current approach in the beta release. Thanks for the PRs, I'll close both as soon as v3 is ready.
I hope you are happy with the solution.
Awesome! I loved working on this tho๐ฅณ
Hi! ๐
Firstly, thanks for your work on this project! ๐ Today I used patch-package to patch
astro-breadcrumbs@2.3.1
for the project I'm working on.I was having an issue where if the URL for example is products/category1/123, I wanted the breadcrumbs to be as follows with sentence case enabled:
Products > Category1 > Product Name
But by default, I get:
Products > Category1 > 123
So I only wanted to change the lastItem text, so I added variable lastText to fix such a scenario
Here is the small fix that solved my problem:
This issue body was partially generated by patch-package.