Developer Portal
Sidebar Configuration
You can configure your Developer Portal Sidebar through the sidebar.json
file.
This file allows you to determine which pages get displayed, their labels, and
their order.
Configuring sidebar.json#
sidebar.json
consists of items of different types
either doc
, category
,
or api-ref
. The file is configured in a very similar way to
Docusaurus' sidebar.js.
The docs
array must contain all the items of the sidebar.
Customizing Individual OpenAPI Specs#
A specs
array is added as an optional property on doc
and category
items.
Not including the specs
array will automatically include the item in all of
your OpenAPI specs. The entries to specs
must match the specId
of the
OpenAPI file (portion of filename preceding .oas.json
) found in your project's
config
folder. For category
types, adding specs
to an item
will result
in the page only displaying if it is also found in the category
item's specs
array.
Sidebar Labels#
A label
property is found on most items. It determines what text appears in
the sidebar navigation. The label can also be provided via
frontmatter using the sidebar_label
property.
Note
If a label is provided on both the sidebar.json
item and the markdown
frontmatter
, the frontmatter
will take precedence.
Adding an api-ref#
An api-ref
item dictates the position of your API Reference docs in the
sidebar. You can also relabel the top-level label (the default is API
Reference). The contents of your API Reference are automatically generated from
your routes.oas.json
.
When you create a project, we will automatically populate the following
api-ref
item in your sidebar.json
:
Adding a doc#
A doc
is a single page that contains content from a markdown file.
Here's an example:
Shorthand#
You can also add a doc
item via shorthand notation in which you only include
the id
field in the sidebar.json
.
Note that you will be unable to specify specs
or defaultPage
, but you can
provide a label in the frontmatter
Adding a category#
A category
is a directory of doc
items. Within your Sidebar, the items
entries will appear nested under the label
of the category
item. Each entry
in items
must contain a unique id
and label
within the items
array.
A category
item can act like a doc
if a link
property is provided. When
clicked the user will be navigated to the page referenced in the link
. If no
link
is provided, then the category
will not be clickable.
Example: