Sometimes you may have so many pages that the navigation sidebar feels cluttered, even when using child pages. Page sections can be used to simplify the navigation structure.
Page sections do not have a source file associated with them, but instead have their own nested groups. When the user clicks a page section link in the navigation sidebar, the groups that are nested under that section will be displayed in the sidebar and the previous groups will disappear. Additionally, a new link will be added to the top of the navigation sidebar allowing users to navigate back to the parent groups.
Follow these steps to create a page section:
{
"title": "My Group",
"groups": []
}
Add the section definition JSON to either:
pages
array of a page groupchildren
array of a parent pageIn addition to the required title
and groups
properties, page section definitions support two optional properties:
The optional output
property supports configuring the name of the directory that pages and groups within the section are rendered to.
👉 For example, the following page definiton would be rendered to
outer-group/my-section/inner-group/my-page.html
:
{
"groups": [
{
"title": "Outer Group",
"output": "outer-group",
"pages": [
{
"title": "My Section",
"output": "my-section",
"groups": [
{
"title": "Inner Group",
"output": "inner-group",
"pages": [
{
"title": "My Page",
"source": "my-page.md",
"output": "my-page.html"
}
]
}
]
}
]
}
]
}
If no output
property is provided, the section's title will be used as the default value.
The optional source
property allows you to configure a default path prefix for the source
property of each group within the section.
👉 For example, the following page would be read from
outer-group/my-section/inner-group/my-page.md
:
{
"groups": [
{
"title": "Outer Group",
"source": "outer-group",
"pages": [
{
"title": "My Section",
"source": "my-section",
"groups": [
{
"title": "Inner Group",
"source": "inner-group",
"pages": [
{
"title": "My Page",
"source": "my-page.md",
}
]
}
]
}
]
}
]
}
By default, no source path prefix is applied when the source
property is omitted.
Generated using TypeDoc