Skip to content

Commit ed556d4

Browse files
committed
rework some version paths and sidebar
1 parent 9ec5e6e commit ed556d4

File tree

6 files changed

+286
-92
lines changed

6 files changed

+286
-92
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"site:build": "bash site/scripts/build-local.sh",
99
"site:serve": "bash site/scripts/serve-local.sh",
1010
"site:clear": "cd site && npm run clear",
11-
"site:reset": "rm -rf site/docs/ site/static/img/v* site/version*",
11+
"site:reset": "rm -rf site/docs/ site/static/img/v* site/version* docs-tmp/",
1212
"sync:to-harperdb": "bash site/scripts/sync-and-convert.sh",
1313
"sync:to-harperdb:sample": "bash site/scripts/sync-and-convert.sh -s",
1414
"sync:to-harperdb:dry": "bash site/scripts/sync-and-convert.sh -d",

site/docusaurus.config.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ if (process.env.NODE_ENV === 'production') {
2727
// Can also be set via command line: npm run build -- --base-url /documentation/
2828
const baseUrl = process.env.DOCUSAURUS_BASE_URL || '/';
2929

30+
// Determine route base path for docs
31+
// Can be set to '/docs/' if we need docs under a subdirectory
32+
// Default is '/' to serve docs at the root
33+
const routeBasePath = process.env.DOCUSAURUS_ROUTE_BASE_PATH || '/';
34+
3035
// URL can also be overridden if needed
3136
const url = process.env.DOCUSAURUS_URL || 'https://docs.harperdb.io';
3237

3338
// Always log configuration at build time
34-
console.log('Docusaurus URL config:', { url, baseUrl });
39+
console.log('Docusaurus URL config:', { url, baseUrl, routeBasePath });
3540

3641
const config: Config = {
3742
title: 'Harper Docs',
@@ -45,7 +50,7 @@ const config: Config = {
4550
},
4651

4752
// Set the production url of your site here
48-
url: url,
53+
url,
4954
// Set the /<baseUrl>/ pathname under which your site is served
5055
baseUrl,
5156

@@ -66,10 +71,10 @@ const config: Config = {
6671
{
6772
docs: {
6873
// Use converted docs from DOCS_PATH or default location
69-
path: process.env.DOCS_PATH || 'docs',
74+
path: process.env.DOCS_PATH || '../docs',
7075
sidebarPath: './sidebars.ts',
71-
// Docs are always at the root of the baseUrl
72-
routeBasePath: '/',
76+
// Docs are served at the configured route base path
77+
routeBasePath,
7378
editUrl: ({ docPath }) => {
7479
// Find where docs/ starts in the path and use everything from there
7580
const docsIndex = docPath.indexOf('docs/');
@@ -172,10 +177,10 @@ const config: Config = {
172177
label: 'Getting Started',
173178
to: '/getting-started',
174179
},
175-
{
176-
label: 'Developers',
177-
to: '/category/developers',
178-
},
180+
// {
181+
// label: 'Developers',
182+
// to: '/developers',
183+
// },
179184
{
180185
label: 'Administration',
181186
to: '/administration',

site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"docusaurus": "docusaurus",
77
"start": "docusaurus start",
88
"sync-latest": "node scripts/sync-latest-version.js",
9-
"build": "npm run sync-latest && docusaurus build",
9+
"build": "docusaurus build",
1010
"version": "node scripts/cut-version.js",
1111
"swizzle": "docusaurus swizzle",
1212
"deploy": "docusaurus deploy",

site/scripts/convert-and-run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,25 @@ if [ ! -d "$SITE_DIR/versioned_docs" ] || [ ! -f "$SITE_DIR/versions.json" ]; th
3232
fi
3333
fi
3434

35+
# Set DOCS_PATH to use the converted docs
36+
export DOCS_PATH="$REPO_ROOT/docs-tmp"
37+
export IMAGES_PATH="$REPO_ROOT/images"
38+
39+
# Optional: Set route base path for docs
40+
# Uncomment and set to '/docs/' if you want docs under a subdirectory
41+
# export DOCUSAURUS_ROUTE_BASE_PATH="/docs/"
42+
3543
# Run the appropriate Docusaurus command
3644
cd "$SITE_DIR"
3745
case "$COMMAND" in
3846
start)
3947
echo "Starting Docusaurus development server..."
48+
echo "Using docs from: $DOCS_PATH"
4049
npm run "$COMMAND"
4150
;;
4251
build)
4352
echo "Building Docusaurus site..."
53+
echo "Using docs from: $DOCS_PATH"
4454
npm run "$COMMAND"
4555
;;
4656
*)

0 commit comments

Comments
 (0)