mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 16:29:47 +02:00
feat(content-docs): sidebar category linking to document or auto-generated index page (#5830)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: Armano <armano2@users.noreply.github.com> Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
This commit is contained in:
parent
95f911efef
commit
cfae5d0933
105 changed files with 3904 additions and 816 deletions
|
@ -5,7 +5,8 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
||||
const sidebars = {
|
||||
sidebar: [
|
||||
{
|
||||
type: 'doc',
|
||||
|
@ -16,11 +17,19 @@ module.exports = {
|
|||
{
|
||||
type: 'category',
|
||||
label: 'Tests',
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
type: 'autogenerated',
|
||||
dirName: 'tests',
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
label: 'External Link test',
|
||||
href: 'https://docusaurus.io',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -40,7 +49,7 @@ module.exports = {
|
|||
label: 'Test Test test test test test test',
|
||||
},
|
||||
],
|
||||
...generateHugeSidebarItems(4),
|
||||
...generateHugeSidebarItems(),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -62,6 +71,7 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
};
|
||||
module.exports = sidebars;
|
||||
|
||||
function generateHugeSidebarItems() {
|
||||
const linksCount = 8;
|
||||
|
@ -87,5 +97,5 @@ function generateHugeSidebarItems() {
|
|||
return [...linkItems, ...categoryItems];
|
||||
}
|
||||
|
||||
return generateRecursive(4);
|
||||
return generateRecursive(3);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue