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

[vuepress sidebar problem] No matching page found for sidebar item "/notes/javascript-new-develop/one" #611

Closed
huiwooo opened this issue Jun 25, 2018 · 3 comments

Comments

@huiwooo
Copy link

huiwooo commented Jun 25, 2018

I'm using the vuepress,but got some problem in the sidebar item:

[vuepress] No matching page found for sidebar item "/notes/javascript-new-develop/one"

my project is:

- blog
-- docs
--- .vuepress
---- dist
---- public
---- config.js
--- readme.md
-- notes
--- javascript-new-develop
---- one.md
-- package.json

sidebar in my config I've written is:

sidebar:{
    '/':[
          {
            title: 'JavaScript语言新发展',
            collapsable: false,
            children: [
              '',
              ['/notes/javascript-new-develop/one', 'JavaScript语言新发展']
            ]
          }
    ]
}

I have tried:

['/notes/javascript-new-develop/one', 'JavaScript语言新发展']
['/notes/javascript-new-develop/one.md', 'JavaScript语言新发展']

but it still

[vuepress] No matching page found for sidebar item "/notes/javascript-new-develop/one"
@ulivz
Copy link
Member

ulivz commented Jun 25, 2018

Remove the slash at the beginning:

['notes/javascript-new-develop/one', 'JavaScript语言新发展']

@ulivz ulivz closed this as completed Jun 25, 2018
@hustjiangtao
Copy link

hustjiangtao commented Jul 25, 2018

When I use vuepress@0.8.4, I use sideBar config such as below:

sidebar: {
  '/post/': [
    {
      title: 'AAA',
      collapsable: true,
      children: [ 'AAA/a' ]
    },
    {
      title: 'BBB',
      collapsable: true,
      children: [ 'BBB/b', 'BBB/bb', 'BBB/bbb' ]
    }
  ],
},

everything goes well.

However, while I upgrade vuepress>=0.9.1 (I tried all versions >=0.9.1), the same error [vuepress] No matching page found for sidebar item "/post/AAA/a" happend.
I think some sth was changed in source code, but I did not found it.

I removed the slash at the beginning just as you say:

sidebar: {
  'post/': [
    {
      title: 'AAA',
      collapsable: true,
      children: [ 'AAA/a' ]
    },
    {
      title: 'BBB',
      collapsable: true,
      children: [ 'BBB/b', 'BBB/bb', 'BBB/bbb' ]
    }
  ],
},

It's all fine with vuepress@0.12.0. But the sideBar missing in the html.

What confused me is that I remember the official document 多个侧边栏 - VuePress官方文档

// .vuepress/config.js
module.exports = {
  themeConfig: {
    sidebar: {
      '/foo/': [
        '',     /* /foo/ */
        'one',  /* /foo/one.html */
        'two'   /* /foo/two.html */
      ],

      '/bar/': [
        '',      /* /bar/ */
        'three', /* /bar/three.html */
        'four'   /* /bar/four.html */
      ],

      // fallback
      '/': [
        '',        /* / */
        'contact', /* /contact.html */
        'about'    /* /about.html */
      ]
    }
  }
}

the slash at the beginning was there.

@ulivz , thanks a lot if you can notice the point for me.

@scil
Copy link

scil commented Feb 17, 2022

official docs is not correct.


update:

Now I use vuepress v2 and yarn , work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants