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

Support exact match for navigation link #3851

Closed
4 tasks done
ansidev opened this issue May 1, 2024 · 1 comment
Closed
4 tasks done

Support exact match for navigation link #3851

ansidev opened this issue May 1, 2024 · 1 comment

Comments

@ansidev
Copy link

ansidev commented May 1, 2024

Is your feature request related to a problem? Please describe.

My site config:

export default defineConfig({
  themeConfig: {
    nav: [
      { link: '/about', text: 'About' },
      { link: '/feed.rss', text: 'RSS' },
    ]
  }
})

The link which will be generated for /feed.rss is /feed.rss.html

Describe the solution you'd like

Add exactMatch?: boolean to the interface NavItemWithLink.

export default defineConfig({
  themeConfig: {
    nav: [
      { link: '/about', text: 'About' },
      { link: '/feed.rss', text: 'RSS', exactMatch: true },
    ]
  }
})

If exactMatch is true, do not append the suffix .html to the generated navigation link.

Describe alternatives you've considered

N/A

Additional context

N/A

Validations

@brc-dd
Copy link
Member

brc-dd commented May 1, 2024

Set this on top of your .vitepress/config - process.env.VITE_EXTRA_EXTENSIONS = 'rss'

@ansidev ansidev closed this as completed May 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 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

No branches or pull requests

2 participants