Docz: `order` field is ignored when `menu` is specified

Created on 16 Oct 2018  路  5Comments  路  Source: doczjs/docz

Bug Report

Describe the bug

order field is ignored when menu is specified

To Reproduce

see https://github.com/sw-yx/fresh-concurrent-react/tree/docz
deployed at https://concurrent-react.netlify.com/

image

when i add an order key to my docs in the api section, nothing moves around

In order to allow us to quickly reproduce you issue please include a link to a reproduction repository.

Expected behavior

order should be respected inside menu, and should go in ascending order

Most helpful comment

@kylealwyn I was able to finally get it working as expected.
I'm not sure how exactly you want to order your menu but in your case i think it needs to be something like this:

export default {
  menu: [
    'Introduction', // auto ordered menu "Introduction"
    {
      name: 'Guides', // manually oredered menu "Guides"
      menu: ['Theming'] // oredered items for "Guides"
    },
    {
      name: 'Components',  // manually oredered menu "Components"
      menu: ['Grid'] // // oredered items for "Components"
    }
  ]
}

You can see an example i made

All 5 comments

@sw-yx, since order property is deprecated, is the version 0.12, ordering using menu is over when you use both to set order. That's not our goal to keep both working 馃槙

@pedronauck Would you mind expanding a little more on that? What is the recommended way to order the menu now? I see this: http://feedback.docz.site/roadmap/p/managing-menu-order-on-doczrc but that new configuration option isn't in the documentation

yeah its ok to deprecate order but then how do i set the menu order haha

I've tried using the new menu config option like so, but moving the options around in any order does not affect menu layout as desired.

```js
// doczrc.js

export default {
...
menu: [['Introduction'], ['Guides', ['Theming']], ['Components', ['Grid']]],
...
}

@kylealwyn I was able to finally get it working as expected.
I'm not sure how exactly you want to order your menu but in your case i think it needs to be something like this:

export default {
  menu: [
    'Introduction', // auto ordered menu "Introduction"
    {
      name: 'Guides', // manually oredered menu "Guides"
      menu: ['Theming'] // oredered items for "Guides"
    },
    {
      name: 'Components',  // manually oredered menu "Components"
      menu: ['Grid'] // // oredered items for "Components"
    }
  ]
}

You can see an example i made

Was this page helpful?
0 / 5 - 0 ratings