question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

External link is not shown in the tab nav

See original GitHub issue

Description

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: image

But not in the desktop navigation:

Desktop: image

Steps to reproduce the bug

  1. Add an external nav item to the top level navigation.
  2. Run mkdocs serve
  3. Resize window to < 1220px show working mobile nav
  4. 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:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MrF3lixcommented, Aug 25, 2020
0reactions
squidfunkcommented, Aug 26, 2020

Released as part of 5.5.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to open a tab from external link? - Stack Overflow
I need to open a Forget Password Tab from the Login Tab Content page via hyperlink there. Below code is working for me...
Read more >
Not able to have links opened up in new tabs - WordPress.org
Things do work, got a navigation bar of somewhat how I want things to go but I want some external links to open...
Read more >
Site navigation external links behavior new tab/same tab
We have a communication site where part of the site navigation has external links. These external links should open in a new tab...
Read more >
How to open external menu links in a new tab with WordPress
If this option is not visible, it means that it's not enabled in the menu screen option. Simply follow those steps to activate...
Read more >
Unable to open external link in new tab ; -blank not working
You can use target="_blank" in link. Please try below sample dashboard. <dashboard> <label>HTMLLink</label> <row> <panel> <html> <a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found