@alauda/doom 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli/load-config.js
CHANGED
|
@@ -26,12 +26,12 @@ const processSideMeta = (sideMeta, extensions, excludeRoutes) => {
|
|
|
26
26
|
}
|
|
27
27
|
const ignored = excludeRoutes.some((glob) => picomatch.isMatch(curr._fileKey, glob));
|
|
28
28
|
let filePart;
|
|
29
|
-
if ((filePart = curr._fileKey.split(
|
|
29
|
+
if ((filePart = curr._fileKey.split(/[\\/]/).at(-1)) &&
|
|
30
30
|
extensions.some((ext) => filePart === `index${ext}`)) {
|
|
31
31
|
if (acc.index?._fileKey) {
|
|
32
32
|
// zh/development/component-quickstart/index.md vs zh/development/index.mdx
|
|
33
33
|
const relative = path.relative(path.dirname(acc.index._fileKey), path.dirname(curr._fileKey));
|
|
34
|
-
if (relative === '..' || relative
|
|
34
|
+
if (relative === '..' || /[\\/]\.\.$/.test(relative)) {
|
|
35
35
|
acc.others.unshift(acc.index);
|
|
36
36
|
acc.index = curr;
|
|
37
37
|
}
|
|
@@ -152,7 +152,7 @@ export const remarkReplace = function ({ lang, localBasePath, root, items, force
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
const newAstChildren = [];
|
|
155
|
-
const currLang = lang === null ? 'zh' : relativePath.split(
|
|
155
|
+
const currLang = lang === null ? 'zh' : relativePath.split(/[\\/]/)[0];
|
|
156
156
|
for (const node of ast.children) {
|
|
157
157
|
if (node.type !== (isMdx ? 'mdxFlowExpression' : 'html')) {
|
|
158
158
|
newAstChildren.push(node);
|