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 an option to include or not the links to parents at nav bar #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sphinx_material/sphinx_material/relbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
{% set localhref=pathto( item.href ) if item.internal else item.href|e %}
<li class="md-tabs__item"><a href="{{ localhref|e }}" class="md-tabs__link">{{ item.title }}</a></li>
{%- endfor %}
{%- for parent in parents %}
<li class="md-tabs__item"><a href="{{ parent.link|e }}" class="md-tabs__link">{{ parent.title }}</a></li>
{%- endfor %}
{%- if theme_nav_bar_display_parents %}
{%- for parent in parents %}
<li class="md-tabs__item"><a href="{{ parent.link|e }}" class="md-tabs__link">{{ parent.title }}</a></li>
{%- endfor %}
{%- endif %}
</ul>
</div>
</nav>
Expand Down
3 changes: 3 additions & 0 deletions sphinx_material/sphinx_material/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ master_doc = True
# internal: Flag indicating to use pathto (bool)
nav_links =

# Include links of parent documents at navigation bar
nav_bar_display_parents = True

# Text to appear at the top of the home page in a "hero" div. Must be a
# dict[str, str] of the form pagename: hero text, e.g., {'index': 'text on index'}
heroes =
Expand Down