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:
Minh Pham 2022-01-06 05:52:25 -05:00 committed by GitHub
parent 3cb99124de
commit eade41a702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 396 additions and 13 deletions

View file

@ -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,