vuejs / vitepress

Vite & Vue powered static site generator.

Home Page:https://vitepress.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support exact match for navigation link

ansidev opened this issue · comments

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

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