Skip to content

Commit 58df808

Browse files
committed
Preview fix test (continued)
1 parent 8a9a649 commit 58df808

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build/html.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ function generatePreview() {
1414
const outPath = path.resolve(__dirname, '..');
1515
const outHTML = srcHTML
1616
// Replace CDN URLs with local paths
17-
.replace(/\/\/cdn.jsdelivr.net\/npm\/docsify@4\//g, '/');
17+
.replace(/\/\/cdn.jsdelivr.net\/npm\/docsify@4\//g, '/')
18+
// Enable basePath to simulate /docs as root
19+
.replace(/(\/\/ )(basePath:)/, '$2');
1820

1921
fs.writeFileSync(path.resolve(outPath, file), outHTML);
2022
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1',
8888
},
8989
auto2top: true,
90-
// basePath: 'docs', // Required for Vercel preview deployment
90+
basePath: 'docs', // Required for Vercel preview deployment
9191
coverpage: true,
9292
executeScript: true,
9393
loadSidebar: true,

0 commit comments

Comments
 (0)