mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-23 14:06:59 +02:00
feat(theme-classic): new navbar item linking to a sidebar (#6139)
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
3cb99124de
commit
eade41a702
12 changed files with 396 additions and 13 deletions
|
@ -85,6 +85,12 @@ const DocItemSchema = NavbarItemBaseSchema.append({
|
|||
docsPluginId: Joi.string(),
|
||||
});
|
||||
|
||||
const DocSidebarItemSchema = NavbarItemBaseSchema.append({
|
||||
type: Joi.string().equal('docSidebar').required(),
|
||||
sidebarId: Joi.string().required(),
|
||||
docsPluginId: Joi.string(),
|
||||
});
|
||||
|
||||
const itemWithType = (type: string | undefined) => {
|
||||
// because equal(undefined) is not supported :/
|
||||
const typeSchema = type
|
||||
|
@ -172,6 +178,10 @@ const NavbarItemSchema = Joi.object({
|
|||
is: itemWithType('doc'),
|
||||
then: DocItemSchema,
|
||||
},
|
||||
{
|
||||
is: itemWithType('docSidebar'),
|
||||
then: DocSidebarItemSchema,
|
||||
},
|
||||
{
|
||||
is: itemWithType('localeDropdown'),
|
||||
then: LocaleDropdownNavbarItemSchema,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue