mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +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
|
@ -60,54 +60,67 @@ Object {
|
|||
Object {
|
||||
"id": "foo/bar",
|
||||
"path": "/docs/foo/bar",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "foo/baz",
|
||||
"path": "/docs/foo/bazSlug.html",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "hello",
|
||||
"path": "/docs/",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "ipsum",
|
||||
"path": "/docs/ipsum",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "lorem",
|
||||
"path": "/docs/lorem",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootAbsoluteSlug",
|
||||
"path": "/docs/rootAbsoluteSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootRelativeSlug",
|
||||
"path": "/docs/rootRelativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootResolvedSlug",
|
||||
"path": "/docs/hey/rootResolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootTryToEscapeSlug",
|
||||
"path": "/docs/rootTryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/absoluteSlug",
|
||||
"path": "/docs/absoluteSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/relativeSlug",
|
||||
"path": "/docs/slugs/relativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/resolvedSlug",
|
||||
"path": "/docs/slugs/hey/resolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/tryToEscapeSlug",
|
||||
"path": "/docs/tryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
],
|
||||
"isLast": true,
|
||||
|
@ -362,54 +375,67 @@ Object {
|
|||
Object {
|
||||
"id": "foo/bar",
|
||||
"path": "/docs/foo/bar",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "foo/baz",
|
||||
"path": "/docs/foo/bazSlug.html",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "hello",
|
||||
"path": "/docs/",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "ipsum",
|
||||
"path": "/docs/ipsum",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "lorem",
|
||||
"path": "/docs/lorem",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootAbsoluteSlug",
|
||||
"path": "/docs/rootAbsoluteSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootRelativeSlug",
|
||||
"path": "/docs/rootRelativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootResolvedSlug",
|
||||
"path": "/docs/hey/rootResolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootTryToEscapeSlug",
|
||||
"path": "/docs/rootTryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/absoluteSlug",
|
||||
"path": "/docs/absoluteSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/relativeSlug",
|
||||
"path": "/docs/slugs/relativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/resolvedSlug",
|
||||
"path": "/docs/slugs/hey/resolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/tryToEscapeSlug",
|
||||
"path": "/docs/tryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
],
|
||||
"isLast": true,
|
||||
|
@ -661,6 +687,7 @@ Object {
|
|||
Object {
|
||||
"id": "team",
|
||||
"path": "/community/next/team",
|
||||
"sidebar": "community",
|
||||
},
|
||||
],
|
||||
"isLast": false,
|
||||
|
@ -674,6 +701,7 @@ Object {
|
|||
Object {
|
||||
"id": "team",
|
||||
"path": "/community/team",
|
||||
"sidebar": "version-1.0.0/community",
|
||||
},
|
||||
],
|
||||
"isLast": true,
|
||||
|
@ -1228,26 +1256,32 @@ Object {
|
|||
Object {
|
||||
"id": "foo/bar",
|
||||
"path": "/docs/next/foo/barSlug",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "hello",
|
||||
"path": "/docs/next/",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/absoluteSlug",
|
||||
"path": "/docs/next/absoluteSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/relativeSlug",
|
||||
"path": "/docs/next/slugs/relativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/resolvedSlug",
|
||||
"path": "/docs/next/slugs/hey/resolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/tryToEscapeSlug",
|
||||
"path": "/docs/next/tryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
],
|
||||
"isLast": false,
|
||||
|
@ -1261,10 +1295,12 @@ Object {
|
|||
Object {
|
||||
"id": "foo/bar",
|
||||
"path": "/docs/foo/bar",
|
||||
"sidebar": "version-1.0.1/docs",
|
||||
},
|
||||
Object {
|
||||
"id": "hello",
|
||||
"path": "/docs/",
|
||||
"sidebar": "version-1.0.1/docs",
|
||||
},
|
||||
],
|
||||
"isLast": true,
|
||||
|
@ -1278,14 +1314,17 @@ Object {
|
|||
Object {
|
||||
"id": "foo/bar",
|
||||
"path": "/docs/1.0.0/foo/barSlug",
|
||||
"sidebar": "version-1.0.0/docs",
|
||||
},
|
||||
Object {
|
||||
"id": "foo/baz",
|
||||
"path": "/docs/1.0.0/foo/baz",
|
||||
"sidebar": "version-1.0.0/docs",
|
||||
},
|
||||
Object {
|
||||
"id": "hello",
|
||||
"path": "/docs/1.0.0/",
|
||||
"sidebar": "version-1.0.0/docs",
|
||||
},
|
||||
],
|
||||
"isLast": false,
|
||||
|
@ -1299,34 +1338,42 @@ Object {
|
|||
Object {
|
||||
"id": "rootAbsoluteSlug",
|
||||
"path": "/docs/withSlugs/rootAbsoluteSlug",
|
||||
"sidebar": "version-1.0.1/docs",
|
||||
},
|
||||
Object {
|
||||
"id": "rootRelativeSlug",
|
||||
"path": "/docs/withSlugs/rootRelativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootResolvedSlug",
|
||||
"path": "/docs/withSlugs/hey/rootResolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "rootTryToEscapeSlug",
|
||||
"path": "/docs/withSlugs/rootTryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/absoluteSlug",
|
||||
"path": "/docs/withSlugs/absoluteSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/relativeSlug",
|
||||
"path": "/docs/withSlugs/slugs/relativeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/resolvedSlug",
|
||||
"path": "/docs/withSlugs/slugs/hey/resolvedSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
Object {
|
||||
"id": "slugs/tryToEscapeSlug",
|
||||
"path": "/docs/withSlugs/tryToEscapeSlug",
|
||||
"sidebar": undefined,
|
||||
},
|
||||
],
|
||||
"isLast": false,
|
||||
|
|
|
@ -11,6 +11,7 @@ export function toGlobalDataDoc(doc: DocMetadata): GlobalDoc {
|
|||
return {
|
||||
id: doc.unversionedId,
|
||||
path: doc.permalink,
|
||||
sidebar: doc.sidebar,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ export type LoadedContent = {
|
|||
export type GlobalDoc = {
|
||||
id: string;
|
||||
path: string;
|
||||
sidebar: string | undefined;
|
||||
};
|
||||
|
||||
export type GlobalVersion = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue