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:
Sébastien Lorber 2021-12-03 14:44:59 +01:00 committed by GitHub
parent 95f911efef
commit cfae5d0933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 3904 additions and 816 deletions

View file

@ -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);
}