-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v2): provide doc sidebar_label through sidebars.js (#4500)
* feat : update SidebarItemDoc type * feat : update assertIsDoc * feat : allow configuring title from sidebar.js * feat : add docs * docs : refactor i18n docs to use label in sidebar.js * test : add test * Update website/docs/guides/docs/sidebar.md Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> * docs : remove backported docs Co-authored-by: Lisa Chandra <52909743+lisa761@users.noreply.github.com> Co-authored-by: Javid <singularity.javid@gmail.com> Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
- Loading branch information
1 parent
f761408
commit 9715048
Showing
14 changed files
with
111 additions
and
11 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...gin-content-docs/src/__tests__/__fixtures__/site-with-doc-label/docs/hello-1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
id: hello-1 | ||
title: Hello 1 | ||
--- | ||
|
||
Hello World 1! | ||
|
8 changes: 8 additions & 0 deletions
8
...gin-content-docs/src/__tests__/__fixtures__/site-with-doc-label/docs/hello-2.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
id: hello-2 | ||
title: Hello 2 | ||
sidebar_label: Hello 2 From Doc | ||
--- | ||
|
||
Hello World 2! | ||
|
14 changes: 14 additions & 0 deletions
14
...s-plugin-content-docs/src/__tests__/__fixtures__/site-with-doc-label/docusaurus.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
module.exports = { | ||
title: 'My Site', | ||
tagline: 'The tagline of my site', | ||
url: 'https://your-docusaurus-test-site.com', | ||
baseUrl: '/', | ||
favicon: 'img/favicon.ico', | ||
}; |
14 changes: 14 additions & 0 deletions
14
...cusaurus-plugin-content-docs/src/__tests__/__fixtures__/site-with-doc-label/sidebars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"docs": [ | ||
{ | ||
"id": "hello-1", | ||
"type": "doc", | ||
"label": "Hello One" | ||
}, | ||
{ | ||
"id": "hello-2", | ||
"type": "doc", | ||
"label": "Hello Two" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
id: crowdin | ||
title: i18n - Using Crowdin | ||
sidebar_label: Using Crowdin | ||
slug: /i18n/crowdin | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
id: git | ||
title: i18n - Using git | ||
sidebar_label: Using Git | ||
slug: /i18n/git | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
id: introduction | ||
title: i18n - Introduction | ||
sidebar_label: Introduction | ||
slug: /i18n/introduction | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
id: tutorial | ||
title: i18n - Tutorial | ||
sidebar_label: Tutorial | ||
slug: /i18n/tutorial | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters