Skip to content

Commit 43e9d81

Browse files
committed
Merge branch 'release'
2 parents fed1166 + 1659046 commit 43e9d81

File tree

7 files changed

+17
-76
lines changed

7 files changed

+17
-76
lines changed

.changeset/pretty-rice-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'docusaurus-plugin-typedoc': patch
3+
---
4+
5+
- Fix sidebar base ids with custom docs path (#802).

devtools/examples/docusaurus-ts/sidebars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const sidebars: SidebarsConfig = {
1010
type: 'doc',
1111
id: 'api/index',
1212
},
13-
items: typedocSidebar,
13+
items: typedocSidebar.items,
1414
},
1515
],
1616
};

devtools/examples/docusaurus/docusaurus.config.js

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -61,76 +61,17 @@ const config = {
6161
entryPoints: [
6262
'../../../packages/typedoc-plugin-markdown/test/fixtures/src/reflections/index.ts',
6363
],
64+
out: 'src/docs/api',
6465
},
6566
],
66-
[
67-
docusaurusPlugin,
68-
{
69-
id: 'api-2',
70-
out: './docs/api-2',
71-
...require(
72-
path.join(
73-
__dirname,
74-
'../../../packages/typedoc-plugin-markdown/test/fixtures/typedoc.cjs',
75-
),
76-
),
77-
tsconfig: path.join(
78-
__dirname,
79-
'../../../packages/typedoc-plugin-markdown/test/fixtures/tsconfig.json',
80-
),
81-
entryPoints: [
82-
'../../../packages/typedoc-plugin-markdown/test/fixtures/src//packages/*',
83-
],
84-
entryPointStrategy: 'packages',
85-
cleanOutputDir: true,
86-
navigation: {
87-
includeFolders: false,
88-
includeGroups: false,
89-
includeCategories: true,
90-
},
91-
excludeScopesInPaths: true,
92-
sidebar: {
93-
pretty: true,
94-
},
95-
},
96-
],
97-
/*[
98-
docusaurusPlugin,
99-
{
100-
id: 'api-3',
101-
out: './docs/api-3',
102-
...require(
103-
path.join(
104-
__dirname,
105-
'../../../packages/typedoc-plugin-markdown/test/fixtures/typedoc.cjs',
106-
),
107-
),
108-
tsconfig: path.join(
109-
__dirname,
110-
'../../../packages/typedoc-plugin-markdown/test/fixtures/tsconfig.json',
111-
),
112-
entryPoints:
113-
'../../../packages/typedoc-plugin-markdown/test/fixtures/src/packages/*',
114-
entryPointStrategy: 'packages',
115-
cleanOutputDir: true,
116-
navigation: {
117-
includeFolders: true,
118-
includeGroups: true,
119-
includeCategories: true,
120-
},
121-
excludeScopesInPaths: true,
122-
sidebar: {
123-
pretty: true,
124-
},
125-
},
126-
],*/
12767
],
12868
presets: [
12969
[
13070
'classic',
13171
/** @type {import('@docusaurus/preset-classic').Options} */
13272
({
13373
docs: {
74+
path: 'src/docs',
13475
sidebarPath: require.resolve('./sidebars.js'),
13576
sidebarCollapsed: true,
13677
numberPrefixParser: false,

devtools/examples/docusaurus/sidebars.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const sidebars = {
2222
type: 'doc',
2323
id: 'api/index',
2424
},
25-
items: require('./docs/api/typedoc-sidebar.cjs'),
25+
items: require('./src/docs/api/typedoc-sidebar.cjs'),
2626
},
27-
{
27+
/* {
2828
type: 'category',
2929
label: 'DOCS 2',
3030
link: {
@@ -41,7 +41,7 @@ const sidebars = {
4141
id: 'api-3/index',
4242
},
4343
items: require('./docs/api-3/typedoc-sidebar.cjs'),
44-
},*/,
44+
},*/
4545
],
4646
};
4747

docs/content/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Image from 'next/image';
1111
<section className="px-4 mx-auto w-full max-w-7xl h-64">
1212
<div className="flex flex-col gap-14 items-center mt-10">
1313
<div className="flex flex-col gap-8 justify-center items-center w-full">
14-
<span className="text-2xl font-black md:text-4xl text-center">
14+
<span className="text-4xl font-black md:text-5xl text-center">
1515
typedoc-plugin-markdown
1616
</span>
1717
<div className="flex md:flex-row items-center text-3xl mt-4">

docs/content/plugins/docusaurus/guides/sidebar.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const sidebars: SidebarsConfig = {
5252
type: 'doc',
5353
id: 'api/index',
5454
},
55-
items: typedocSidebar,
55+
items: typedocSidebar.items,
5656
},
5757
],
5858
};

packages/docusaurus-plugin-typedoc/src/plugin/sidebar.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ export function writeSidebar(
1818
: 'typedoc-sidebar.cjs';
1919
const sidebarPath = path.resolve(outputDir, sidebarFileName);
2020

21-
let baseDir = path
22-
.relative(siteDir, outputDir)
23-
.split(path.sep)
24-
.slice(1)
25-
.join('/');
26-
27-
if (docsPresetPath) {
28-
baseDir = adjustBaseDirectory(baseDir, docsPresetPath);
29-
}
21+
const baseDir = adjustBaseDirectory(
22+
path.relative(siteDir, outputDir).split(path.sep).join('/'),
23+
docsPresetPath || 'docs',
24+
);
3025

3126
const sidebarJson = getSidebar(
3227
navigation,

0 commit comments

Comments
 (0)