File tree Expand file tree Collapse file tree 7 files changed +17
-76
lines changed
plugins/docusaurus/guides
packages/docusaurus-plugin-typedoc/src/plugin Expand file tree Collapse file tree 7 files changed +17
-76
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' docusaurus-plugin-typedoc ' : patch
3+ ---
4+
5+ - Fix sidebar base ids with custom docs path (#802 ).
Original file line number Diff line number Diff 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} ;
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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" >
Original file line number Diff line number Diff 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};
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments