Skip to content

Allow NavLinks to open in the same window (applies to default theme) #1353

Closed
adamlaska/osmos-cosmos-sdk
#5
@bryanvaz

Description

@bryanvaz

Feature request

Similar to #186, the nav links in the the default theme should also allow devs to define if a link should open in a new tab or the same tab.

What problem does this feature solve?

If there are .html files in the public directory, or external sites we want to link to (one of our links says "Back to "), but not open in a new window, we should at least have the option to override the target=_blank.

What does the proposed API look like?

Same as before

How should this be implemented in your opinion?

So essentially, the theme config would look like this if we wanted an external link to open in the same tab:

themeConfig: {
    nav: [
      { text: 'Home', link: '/' },
      {
        text: 'Partners',
        items: [
          { text: 'Site 1 that opens in a new tab', link: 'https://site1.com' },
          { text: 'Site 2 opens in same tab', link: 'https://site2.com', target: null }
        ]
      }
    ]
  }

with the same logic as #186 applied to the NavLink component

Are you willing to work on this yourself?**

Sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions