vuejs/vitepress

Error in Previous page and Next page

Closed this issue · 2 comments

Describe the bug

When I go to my FAQ tab, for example, I have a series of articles in my sidebar.
For each of them the link to the next page is always the link to the first article.

Reproduction

My configuration is something like this

"/en/faq/": [
            {
              text: 'FAQ',
              items: [
                { text: 'foo text', link: './foo-link' },
                { text: 'bar text', link: './bar-link' },

If I modify it to :

"/en/faq/": [
            {
              text: 'FAQ',
              items: [
                { text: 'foo text', link: '/en/faq/foo-link' },
                { text: 'bar text', link: '/en/faq/bar-link' },

It works correctly but I think it's a bit of a pain to have to add the prefix to all links.

Expected behavior

I would expect it to work correctly with:

"/en/faq/": [
            {
              text: 'FAQ',
              items: [
                { text: 'foo text', link: './foo-link' },
                { text: 'bar text', link: './bar-link' },

System Info

System:
    OS: Linux 6.4 Fedora Linux 38 (Container Image)
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
    Memory: 8.57 GB / 15.25 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.3.1 - ~/.nvm/versions/node/v20.3.1/bin/node
    npm: 9.6.7 - ~/.nvm/versions/node/v20.3.1/bin/npm
  npmPackages:
    vitepress: ^1.0.0-rc.10 => 1.0.0-rc.13 

Additional context

No response

Validations

brc-dd commented

Relative links are resolved relative to the current page. They aren't recommended as then the sidebar will have different links depending on where the user is at moment. You can do something like this instead:

 '/en/faq/': { base: '/en/faq/', items: [ { text: 'foo text', link: 'foo-link' }, ...

Perfect, thank you for your time and for the advice.

Best regards!