fix: build on Windows (#18831)
This commit is contained in:
committed by
mrugesh mohapatra
parent
e1335d774b
commit
bad6fc3e53
@ -13,6 +13,7 @@ const guideDir = `../../../${
|
||||
}/${locale}`;
|
||||
|
||||
const pagesDir = path.resolve(__dirname, guideDir);
|
||||
const indexMdRe = new RegExp(`\\${path.sep}index.md$`);
|
||||
|
||||
function withGuidePrefix(str) {
|
||||
return `/guide${str}`;
|
||||
@ -26,10 +27,9 @@ exports.createNavigationNode = function createNavigationNode(node) {
|
||||
parent
|
||||
} = node;
|
||||
|
||||
const nodeDir = fileAbsolutePath.replace(/\/index\.md$/, '');
|
||||
const dashedName = nodeDir.split('/').slice(-1)[0];
|
||||
const [, nodePath] = nodeDir.split(pagesDir);
|
||||
|
||||
const nodeDir = path.resolve(fileAbsolutePath).replace(indexMdRe, '');
|
||||
const dashedName = nodeDir.split(path.sep).slice(-1)[0];
|
||||
const nodePath = nodeDir.split(pagesDir)[1].split(path.sep).join('/');
|
||||
const parentPath = nodePath
|
||||
.split('/')
|
||||
.slice(0, -1)
|
||||
|
Reference in New Issue
Block a user