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

Links in the Nav bar do not support rewrites #4364

Open
4 tasks done
ThePlenkov opened this issue Nov 15, 2024 · 0 comments
Open
4 tasks done

Links in the Nav bar do not support rewrites #4364

ThePlenkov opened this issue Nov 15, 2024 · 0 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@ThePlenkov
Copy link

Describe the bug

I have a /guide path redirecting to one of first pages like guide/product and it works if I click action button, feature button or just change the route.

However it doesn't work if I click a nav button

Reproduction

import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({ 
  rewrites: {
    '/guide': "guide/intro"
  },
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: 'Home', link: '/' },
      { text: 'Guide', link: '/guide' }
    ],

    sidebar: {

      "/guide": [
        {
          text: 'Introduction',
          items: [
            { text: 'Intro?', link: '/guide/intro/' },
          ]
        },
]

    }
  }

)

Expected behavior

I expect that clicking a link in the nav would handle it same way as it handles it everywhere else on the site

System Info

System:
    OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 12th Gen Intel(R) Core(TM) i7-1265U
    Memory: 7.76 GB / 11.69 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 22.9.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.3 - /usr/local/bin/npm
    pnpm: 9.12.1 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    vitepress: ^1.5.0 => 1.5.0

Additional context

No response

Validations

@ThePlenkov ThePlenkov added the bug: pending triage Maybe a bug, waiting for confirmation label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant