mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 12:37:01 +02:00
feat(v2): doc navbar item type (#3539)
* provide DocNavbarItem type * update snapshots * Fix Docusaurus tabs CSS * revert navbar tabs css/style changes, instead apply simple navbar__link--active class + make it configurable * Update website/docs/theme-classic.md Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com> * add dropdownActiveClassDisabled option Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
This commit is contained in:
parent
9134b1396b
commit
9ba28a378f
12 changed files with 198 additions and 37 deletions
|
@ -68,6 +68,16 @@ const DocsVersionDropdownNavbarItemSchema = Joi.object({
|
|||
type: Joi.string().equal('docsVersionDropdown').required(),
|
||||
position: NavbarItemPosition,
|
||||
docsPluginId: Joi.string(),
|
||||
dropdownActiveClassDisabled: Joi.boolean(),
|
||||
});
|
||||
|
||||
const DocItemSchema = Joi.object({
|
||||
type: Joi.string().equal('doc').required(),
|
||||
position: NavbarItemPosition,
|
||||
docId: Joi.string().required(),
|
||||
label: Joi.string(),
|
||||
docsPluginId: Joi.string(),
|
||||
activeSidebarClassName: Joi.string().default('navbar__link--active'),
|
||||
});
|
||||
|
||||
// Can this be made easier? :/
|
||||
|
@ -94,6 +104,10 @@ const NavbarItemSchema = Joi.object().when({
|
|||
is: isOfType('docsVersionDropdown'),
|
||||
then: DocsVersionDropdownNavbarItemSchema,
|
||||
},
|
||||
{
|
||||
is: isOfType('doc'),
|
||||
then: DocItemSchema,
|
||||
},
|
||||
{
|
||||
is: isOfType(undefined),
|
||||
then: Joi.forbidden().messages({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue