From b82e211546f6e369a7d6fc4c64160de4f80e8243 Mon Sep 17 00:00:00 2001 From: Thakur Karthik Date: Wed, 16 Oct 2019 14:56:58 +0530 Subject: [PATCH] docs(v2): update sidebar migration from v1 to v2 guide (#1845) * update docs for sidebar.json in migration from v1 to v2 This change is regarding an issue opened at here https://github.com/facebook/docusaurus/issues/1841 * removed duplicates in migration doc * Update migrating-from-v1-to-v2.md --- website/docs/migrating-from-v1-to-v2.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/website/docs/migrating-from-v1-to-v2.md b/website/docs/migrating-from-v1-to-v2.md index 46a494d45b..46485494cd 100644 --- a/website/docs/migrating-from-v1-to-v2.md +++ b/website/docs/migrating-from-v1-to-v2.md @@ -357,6 +357,22 @@ The following fields are all deprecated, you may remove from your configuration We intend to implement many of the deprecated config fields as plugins in future. Help will be appreciated! +## Migrate your sidebar + +In previous version, nested sidebar category is not allowed and sidebar category can only contain doc id. However, v2 allows infinite nested sidebar and we have many types of [Sidebar Item](sidebar.md#sidebar-item) other than document. + +You'll have to migrate your sidebar if it contains category type. Rename `subcategory` to `category` and `ids` to `items`. + +```js +{ +- type: 'subcategory', ++ type: 'category', + label: 'My Example Subcategory', ++ items: ['doc1'], +- ids: ['doc1'] +}, +``` + ## Delete footer file `website/core/Footer.js` is no longer needed. If you want to modify the default footer provided by docusaurus, [swizzle](using-themes.md#swizzling-theme-components) it: