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

Add breadcrumbs to taxonomy result list #1011

Merged
merged 7 commits into from
Jun 13, 2022

Conversation

at055612
Copy link
Contributor

Fixes #1004

  • Adds a card around each item in the taxonomy result list
  • Adds a breadcrumb line to each taxonomy result
    • Makes it clear the location of the item
    • Provides the means to open an ancestor of a result item
    • Can be disabled using site param taxonomy_breadcrumb_disable, enabled by default
  • Changed the breadcrumb so that the leaf item is not a clickable link

I think the cards could do with some drop shadow but I haven't added it as I wasn't sure it was consistent with the rest of the theme.

Making the leaf item not a link is possibly contentious but a quick google suggests this is an accepted practice. I think having a link to the page you are on is confusing and offers no value.

This is how it now looks on the example site

image

This is how it looks for a result that is at the root level.

image

But if .td-breadcrumbs__single { display: none !important; } is set in the project scss then you will see:

image

The page breadcrumbs now look like this:

image

@deining deining added the taxonomy related to hugo taxomomies label May 17, 2022
@LisaFC
Copy link
Collaborator

LisaFC commented May 18, 2022

This is great! @narrenfrei if you're free do you want to take a closer look at this as you did a lot of the taxonomy support? I'll take a look as well.

@raum51
Copy link
Contributor

raum51 commented May 26, 2022

Looks fine - thank you for the great work!

@LisaFC
Copy link
Collaborator

LisaFC commented Jun 13, 2022

Looks good to me! Thanks again.

@LisaFC LisaFC merged commit 0dc154d into google:main Jun 13, 2022
@LisaFC
Copy link
Collaborator

LisaFC commented Jun 13, 2022

Follow-up: can you add a quick update to the docs telling users how to disable the taxonomy breadcrumb feature if required?

@at055612 at055612 deleted the gh-1004-taxonomy-list-breadcrumbs branch June 14, 2022 07:53
@at055612
Copy link
Contributor Author

at055612 commented Jun 14, 2022

Follow-up: can you add a quick update to the docs telling users how to disable the taxonomy breadcrumb feature if required?

@LisaFC Thanks for merging. See #1048 for the docs update.

@@ -18,8 +18,11 @@
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) -}}
{{ end -}}
{{ $isActive := eq .p1 .p2 }}
<li class="breadcrumb-item{{ if $isActive }} active{{ end }}"
{{- if $isActive }} aria-current="page"{{ end }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@at055612 - why did you remove aria-current?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I can't remember why I took that out. Maybe because I don't think it is applicable when the breadcrumb is shown on the taxonomy list, however I agree it ought to be there for the page breadcrumbs. Will take a look.

Copy link
Collaborator

@chalin chalin Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I've reverted this change -- see #1068. We would need a bit more logic to remove (all?) the ARIA related labels for the taxonomy-list usage ... or maybe just use a regex to strip all aria labels from breadcrumbs in taxonomy list. I'll let you follow up on that if you think that it's worth it.

fekete-robert pushed a commit to fekete-robert/docsy that referenced this pull request Sep 13, 2022
* googlegh-1004 Add breadcrumbs and cards to taxonomy result list

* googlegh-1004 Change breadcrumb partial so leaf item is not a link

* googlegh-1004 Format scss

Co-authored-by: LisaFC <lcarey@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
taxonomy related to hugo taxomomies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add breadcrumbs to taxonomy result list
5 participants