Skip to content

Conversation

rickdubiel
Copy link
Contributor

It seems that by default, VitePress automatically adds an icon based on whether the link is an external link or not. I see that there's an option to disable external link icons entirely but that wasn't quite what I was looking for (plus couldn't get it to work). I also noticed that this option used to exist but was removed here which made sense for that use case, but this PR makes it optionally able to be removed on a "per link" level.

User Case:

export default {
  themeConfig: {
    nav: [
      // don't want the external link icon here.
      { text: 'Support', link: 'mailto:[email protected]?subject=Support Request', noIcon: true },
      // want the external link icon here.
      { text: 'Sign in', link: 'https://website.com/login' }
    ]
  }
}

This seems to work very nicely and gave the results I was looking for. I'm hoping this can be added.

Results:

image

@brc-dd brc-dd changed the title feat(theme): Add noIcon option to VPNavBarMenuLink component feat(theme): allow selectively disabling external link icon on navbar items Mar 7, 2024
@brc-dd brc-dd merged commit 5f6297c into vuejs:main Mar 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants