-
Notifications
You must be signed in to change notification settings - Fork 28
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 breadcrumbs. #166
Fix breadcrumbs. #166
Conversation
I just found one that is mindblowingly long: Developer / Coding Standards Handbook / Inline Documentation Standards / JavaScript Documentation Standards @jasmussen, Any idea on what we can do here? |
Keeping in mind I'm not aware of what's technically feasible here, my instinct would be this:
That is, show the first and last clickable breadcrumbs. Alternately we just allow wrapping. It would be good to see this in context before we settle on it, though. |
This method was what I intended we'd do for all these subsites when I made it, you can see in Documentation how I used it there. Could you refactor whatever's giving you HTML to return the url/title format used by
We've had a similar issue on Documentation (up to 4 parts, but article titles can be very long. I also wrote some CSS to hide those middle paths in the Docs theme. Whatever the solution for this, it would be best to port back up to the |
f2c7687
to
78ab475
Compare
1e4ef9a
to
73855e6
Compare
Alright, I updated to use the |
Co-authored-by: Dion Hulse <dion@wordpress.org>
Co-authored-by: Dion Hulse <dion@wordpress.org>
Closes: #163
This PR creates a component and calls
breadcrumb_trail
to create the site breadcrumbs. I chose to not usesite-breadcrumbs
because of how complex the breadcrumb logic is for this theme.Since handbook paths can be up to 5 parts long of varying lengths, I had to come up with a system to truncate. I added some CSS to handle that truncation by hiding items left to right starting after the "home" link as the viewport shrinks. It seems to work well although I'll admit I'm not certain I've seen the longest path to test against yet. I have also only handled up to 5 parts. I think we should reconsider our approach if articles are nested 6 or more times.
Alternatives
Use site-breadcrumbs filter.
When the breadcrumb code is created in this theme, HTML is already added to the
$items
list. If we wanted to make use of thewporg_block_site_breadcrumbs
filter we would have to strip that all out. Not the hardest thing to do, but slight risk.I could be convinced down this path, in
50/50
.Screenshots