Support exact match for navigation link
ansidev opened this issue · comments
Le Minh Tri commented
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
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
Divyansh Singh commented
Set this on top of your .vitepress/config
- process.env.VITE_EXTRA_EXTENSIONS = 'rss'