Skip to content

Commit

Permalink
fix(v2): do not show sidebar on reserved docs home page (#2785)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored May 22, 2020
1 parent b6b108e commit 783e7e7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-content-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export default function pluginContentDocs(
const versionsRegex = new RegExp(versionsNames.join('|'), 'i');

const routes = await Promise.all(
metadataItems.map(async (metadataItem, i) => {
metadataItems.map(async (metadataItem) => {
const isDocsHomePage =
metadataItem.id.replace(versionsRegex, '').replace(/^\//, '') ===
options.homePageId;
Expand All @@ -353,10 +353,6 @@ export default function pluginContentDocs(
? ''
: metadataItem.version!) ?? '';

// To show the sidebar, get the sidebar key of available sibling item.
metadataItem.sidebar = (
metadataItems[i - 1] ?? metadataItems[i + 1]
).sidebar;
const docsBaseMetadata = createDocsBaseMetadata(
metadataItem.version!,
);
Expand Down

0 comments on commit 783e7e7

Please sign in to comment.