Skip to content

Commit

Permalink
getMainDocId should return doc with both versioned or unversioned id (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Dec 10, 2021
1 parent ae9a12f commit fd2934d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/docusaurus-plugin-content-docs/src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ export function getMainDocId({
if (versionHomeDoc) {
return versionHomeDoc;
} else if (firstDocIdOfFirstSidebar) {
return docs.find((doc) => doc.id === firstDocIdOfFirstSidebar)!;
return docs.find(
(doc) =>
doc.id === firstDocIdOfFirstSidebar ||
doc.unversionedId === firstDocIdOfFirstSidebar,
)!;
} else {
return docs[0];
}
Expand Down

0 comments on commit fd2934d

Please sign in to comment.