@@ -59,51 +59,67 @@ const config: Config = {
5959 onBrokenLinks : 'warn' ,
6060 onBrokenMarkdownLinks : 'warn' ,
6161
62- presets : [
62+ plugins : [
63+ // Main documentation
6364 [
64- '@docusaurus/preset-classic ' ,
65+ '@docusaurus/plugin-content-docs ' ,
6566 {
66- docs : {
67- path : './docs' ,
68- sidebarPath : './sidebars.ts' ,
69- // Docs are served at the configured route base path
70- routeBasePath,
71- editUrl : ( { versionDocsDirPath, docPath } ) => {
72- // For versioned docs: versionDocsDirPath is like 'versioned_docs/version-4.6'
73- // For current docs: versionDocsDirPath is 'docs'
74- if ( versionDocsDirPath . startsWith ( 'versioned_docs' ) ) {
75- // Versioned docs are in versioned_docs/version-X.X/
76- return `https://github.com/HarperDB/documentation/blob/main/${ versionDocsDirPath } /${ docPath } ` ;
77- } else {
78- // Current docs are in the root docs/ directory
79- return `https://github.com/HarperDB/documentation/blob/main/docs/${ docPath } ` ;
80- }
67+ id : 'default' ,
68+ path : './docs' ,
69+ sidebarPath : './sidebars.ts' ,
70+ routeBasePath,
71+ editUrl : ( { versionDocsDirPath, docPath } ) => {
72+ // For versioned docs: versionDocsDirPath is like 'versioned_docs/version-4.6'
73+ // For current docs: versionDocsDirPath is 'docs'
74+ if ( versionDocsDirPath . startsWith ( 'versioned_docs' ) ) {
75+ // Versioned docs are in versioned_docs/version-X.X/
76+ return `https://github.com/HarperDB/documentation/blob/main/${ versionDocsDirPath } /${ docPath } ` ;
77+ } else {
78+ // Current docs are in the root docs/ directory
79+ return `https://github.com/HarperDB/documentation/blob/main/docs/${ docPath } ` ;
80+ }
81+ } ,
82+ lastVersion : '4.6' ,
83+ includeCurrentVersion : false ,
84+ versions : {
85+ '4.6' : {
86+ banner : 'none' , // No banner for this version
8187 } ,
82- lastVersion : '4.6' ,
83- includeCurrentVersion : false ,
84- versions : {
85- '4.6' : {
86- banner : 'none' , // No banner for this version
87- } ,
88- '4.5' : {
89- // No banner for 4.5 as its still actively maintained. Docusaurus doesn't allow us to set custom
90- // text for the banner. Only option is to eject swizzle DocVersionBanner (`npm run swizzle @docusaurus/theme-classic DocVersionBanner -- --eject`)
91- // and modify the internal rendering logic based on the version number. Cannot even add a new `banner` option without even more hackery.
92- // Here is a relevant discussion thread: https://github.com/facebook/docusaurus/discussions/7112 if we really want this, we should look to contribute this feature.
93- banner : 'none' ,
94- } ,
88+ '4.5' : {
89+ // No banner for 4.5 as its still actively maintained
90+ banner : 'none' ,
9591 } ,
96- remarkPlugins : [ [ require ( '@docusaurus/remark-plugin-npm2yarn' ) , { sync : true } ] ] ,
9792 } ,
98- blog : false ,
99- theme : {
100- customCss : './src/css/custom.css' ,
93+ remarkPlugins : [ [ require ( '@docusaurus/remark-plugin-npm2yarn' ) , { sync : true } ] ] ,
94+ } ,
95+ ] ,
96+
97+ // Release Notes documentation
98+ [
99+ '@docusaurus/plugin-content-docs' ,
100+ {
101+ id : 'release-notes' ,
102+ path : 'release-notes' ,
103+ routeBasePath : 'release-notes' ,
104+ sidebarPath : './sidebarsReleaseNotes.ts' ,
105+ editUrl : 'https://github.com/HarperDB/documentation/blob/main/' ,
106+ // Reverse order and filter out index files from sidebar
107+ async sidebarItemsGenerator ( { defaultSidebarItemsGenerator, ...args } ) {
108+ const sidebarItems = await defaultSidebarItemsGenerator ( args ) ;
109+ return sidebarItems . filter ( ( i : any ) => ! i . id ?. endsWith ( '/index' ) ) . reverse ( ) ;
101110 } ,
102- } satisfies Preset . Options ,
111+ } ,
103112 ] ,
104- ] ,
105-
106- plugins : [
113+
114+ // Theme
115+ [
116+ '@docusaurus/theme-classic' ,
117+ {
118+ customCss : './src/css/custom.css' ,
119+ } ,
120+ ] ,
121+
122+ // Redirects
107123 [
108124 '@docusaurus/plugin-client-redirects' ,
109125 {
@@ -137,7 +153,7 @@ const config: Config = {
137153 } ,
138154
139155 themeConfig : {
140- // Replace with your project 's social card
156+ // Project 's social card
141157 image : 'img/HarperOpenGraph.png' ,
142158 navbar : {
143159 logo : {
@@ -153,6 +169,14 @@ const config: Config = {
153169 position : 'left' ,
154170 label : 'Documentation' ,
155171 } ,
172+ {
173+ // Link directly to v4 (current version) instead of overview page
174+ type : 'doc' ,
175+ docsPluginId : 'release-notes' ,
176+ docId : 'v4-tucker/index' ,
177+ position : 'left' ,
178+ label : 'Release Notes' ,
179+ } ,
156180 {
157181 type : 'docsVersionDropdown' ,
158182 position : 'right' ,
0 commit comments