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

feat(theme): allow selectively disabling external link icon on navbar items #3607

Merged
merged 3 commits into from Mar 7, 2024

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:support@website.com?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
3 checks passed
@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.

None yet

2 participants