Skip to content

Commit 68c2699

Browse files
committed
single unversioned release notes section
1 parent e69b09d commit 68c2699

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+2816
-41
lines changed

docusaurus.config.ts

Lines changed: 63 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -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',

redirects.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ type RedirectRule = {
66
from: string | string[];
77
};
88

9-
// Function to generate redirects with the appropriate base path
10-
export function generateRedirects(basePath: string): RedirectRule[] {
9+
// Release notes redirects (not affected by base path)
10+
function generateReleaseNotesRedirects(): RedirectRule[] {
11+
return [
12+
];
13+
}
14+
15+
// Documentation redirects
16+
function generateDocsRedirects(basePath: string): RedirectRule[] {
1117
// Helper to add base path to a route
1218
const withBase = (path: string) => {
1319
// If basePath is just '/', return path as-is to avoid double slashes
@@ -143,6 +149,14 @@ export function generateRedirects(basePath: string): RedirectRule[] {
143149
];
144150
}
145151

152+
// Combine all redirects
153+
export function generateRedirects(basePath: string): RedirectRule[] {
154+
return [
155+
...generateReleaseNotesRedirects(),
156+
...generateDocsRedirects(basePath),
157+
];
158+
}
159+
146160
// For backward compatibility, export a default set with empty base path
147161
export const redirects = generateRedirects('');
148162

0 commit comments

Comments
 (0)