External link is not shown in the tab nav
See original GitHub issueDescription
According to the MkDocs docs it is allowed to have external links in the navigation. However it is not shown on desktop. A similar issue has been closed but in my opinion this is not solved.
Expected behavior
The external navigation item should be shown in the mobile navigation and on the tab navigation on desktop.
Actual behavior
The external link is only shown in the mobile navigation.
Mobile:
But not in the desktop navigation:
Desktop:
Steps to reproduce the bug
- Add an external nav item to the top level navigation.
- Run
mkdocs serve
- Resize window to < 1220px show working mobile nav
- Resize window to > 1220px to show desktop nav
Package versions
- Python:
3.8.2
- MkDocs:
1.1.2
- Material:
5.5.8
Project configuration
Navigation config looks similar to this:
nav:
- ALM: []
- DevOps: []
- UI Styleguide: []
- Mercury: []
- SCHS: []
- Sensors: []
- Bühler Insights: https://docs.buhlergroup.io
Notes
I think it works in the nav-item.html
because it renders items that have no child elements.
Where as tab-item.html
only renders items that have children or are the main page.
My suggestion is to add this to line 69 in tabs-item.html:
{% else %}
<li class="md-tabs__item">
<a href="{{ nav_item.url | url }}" class="md-tabs__link">
{{ nav_item.title }}
</a>
</li>
{% endif %}
But I’m not sure what the reason is to not have this here? Let me know if I should create a PR to fix this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
#1885
Released as part of 5.5.9