-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(docz): ordering menu on doczrc #322
Conversation
c9193ee
to
e5c2b39
Compare
Great job @mpivaa, you're doing a really great work, thanks 👏 So, about this task, sorry to tell that just now, but I was thinking of something a little bit different and maybe a little bit complicated too... The idea is to use the export default {
menu: [
'Getting Started',
{
name: 'Components',
menu: [
'Alerts',
'Button',
...
],
},
{
name: 'Github',
route: 'https://github.com/pedronauck/docz'
}
]
} But this is can be kinda a breaking change because of today when we use |
if (a < b) return reverse ? 1 : -1 | ||
if (a > b) return reverse ? -1 : 1 | ||
return 0 | ||
} | ||
|
||
const UNKNOWN_POS = 999999 // TODO: fix this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that use Infinity
like the sortOrder
method in this link is better:
https://github.com/mdx-js/mdx/blob/master/docs/_app.js#L49-L60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about Infinity
too, I will change
I think these changes makes sense, but definitely they are breaking changes, maybe we should always pass an object as the |
Yeah, for sure @mpivaa, this will be a breaking change definitely 😕 So, I think that is best we keep baby steps here and release this feature like people want, in a simple way and. Maybe leave this change to release in v1.0 and we can put some others nice things together ✌️ |
@pedronauck I can see you are not using |
@hnordt It would break if the user defines |
0e8f0dd
to
4386c52
Compare
4386c52
to
ce4d615
Compare
@pedronauck I've changed the config interface so it looks like: export default {
menu: [
'Getting Started',
{
name: 'Components',
docs: [
'Alerts',
'Button',
...
],
}
]
} That way when we change the implementation of |
If I were to try and implement this now, would it work? v0.11.2 |
What version will this be released on @pedronauck @mpivaa ? |
Will be released in the |
Ordering menu on doczrc
Based on http://feedback.docz.site/roadmap/p/managing-menu-order-on-doczrc
Pre-merge checklist