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

Avoid displaying just title in breadcrumbs #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nineteendo
Copy link

@pradyunsg
Copy link
Owner

Hmm... Isn't breadcrumb_include_page sufficient for controlling whether just the page title is shown?

@pradyunsg
Copy link
Owner

pradyunsg commented Oct 6, 2024

From https://sphinx-basic-ng.readthedocs.io/en/latest/usage/components/breadcrumbs/:

There are 2 values that can be provided via the html-context, which provide control over the components shown in the breadcrumbs:

[snip]

  • breadcrumb_include_page: If truthy, the current page is included in the breadcrumb as the final list-item, with only a span (there’s no a[href] in it). The corresponding list-item will have an additional class: breadcrumb-nav-page-item.

@nineteendo
Copy link
Author

It's just a bit pointless to show breadcrumbs if there are no links to parent pages. You're just repeating the title for no benefit. By not doing this you can use the style of https://just-the-docs.com.

@pradyunsg
Copy link
Owner

pradyunsg commented Oct 6, 2024

It's just a bit pointless to show breadcrumbs if there are no links to parent pages.

I agree, but disagree that having it in the DOM is useless.

Scroll on https://pradyunsg-cpython-lutra-testing.readthedocs.io/en/latest/c-api/index.html -- that's an excellent example of why having the current page title in breadcrumbs is useful.

@nineteendo
Copy link
Author

I'm afraid you don't understand what I mean, so let me try again with some images:

  1. The breadcrumbs here don't add any value, they just repeat the title without linking to a parent:
Screenshot 2024-10-06 at 13 29 13
  1. They also don't add value if they link to the home page on the home page (that's why we have pagename != 'index'):
Screenshot 2024-10-06 at 13 38 34
  1. On child pages, they're useful because they link to the parents:
Screenshot 2024-10-06 at 13 31 48

@nineteendo
Copy link
Author

nineteendo commented Oct 13, 2024

Do you think this should be configurable? In the long run I want to delete my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants