-
Notifications
You must be signed in to change notification settings - Fork 2
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update Navigation #95
Comments
ZUP-3539 Update Navigation
The current state of the navigation configuration is split into three different areas of the configuration which makes it somewhat difficult to think through it. The user needs to understand that various I think we can simplify this by instead using a single {
navigation: {
tabs: {
[
{ label: "Home", type: "doc", id: "index" },
{
label: "Documentation",
link: "/docs/overview",
sidebar: [
{ type: "doc", label: "Overview", id: "docs/overview" },
{
type: "category",
label: "Subcategory",
items: ["docs/example", "docs/other-example"],
},
],
},
{
type: "api-reference",
id: "my-api",
},
];
}
}
} The above configuration would render the following tabs
A few other notes:
|
So I was playing around with using Zudoku on the zuplo docs site and one thing that I ran into was I realized just how tied together the top nav and the sidebar are to the URLs in the path. Additionally how the topnav is tied to the file system locations of the docs. I think these are both mistakes. If there is one thing I have learned in my years of managing many docs sites is that sidebar navigation and product categorization needs to be separate of UI - concretely, URLs should essentially be immutable regardless of how the sidebar navigation or top level navigation is laid out. We are going to change those a lot, but if we have to move files around on the file system and change URLs it is going to make it very hard to do so. I think we need to change the following:
This will mean that it is possible to put documents in multiple sidebars which will make it so that we cannot know definitely which is the current sidebar. We will probably just have to pick the first sidebar the document is in. I think docusaurus also has this issue. I think this is a small tradeoff in order to keep the URLs and file system locations of articles static even when your navigation structure changes. |
The current state of the navigation configuration is split into three different areas of the configuration which makes it somewhat difficult to think through it. The user needs to understand that various
id
references point tosidebar
items, etc.I think we can simplify this by instead using a single
navigation
configuration that is a tree with explicit references. With this change theid
object always references from the navigation configuration out to another thing - a document, an api, or whatever we have in the future. Each "type" can reference its own id.The above configuration would render the following tabs
/my-api
A few other notes:
/pages/docs/example
, the id would bedocs/example
sidebar_label
or in the case of an API it would be the api name as defined in the openapi specThe text was updated successfully, but these errors were encountered: