fumadocs-core 12.1.1 → 12.1.3
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/dist/source/index.js +5 -3
- package/package.json +1 -1
package/dist/source/index.js
CHANGED
|
@@ -345,12 +345,14 @@ function buildPageMap(storage, languages, getUrl) {
|
|
|
345
345
|
}
|
|
346
346
|
function createGetUrl(baseUrl) {
|
|
347
347
|
return (slugs, locale) => {
|
|
348
|
-
const paths = locale ? [...
|
|
349
|
-
return `/${paths.join("/")}`;
|
|
348
|
+
const paths = locale ? [locale, ...baseUrl.split("/"), ...slugs] : [...baseUrl.split("/"), ...slugs];
|
|
349
|
+
return `/${paths.filter((v) => v.length > 0).join("/")}`;
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
352
|
function getSlugs(info) {
|
|
353
|
-
const result = [...
|
|
353
|
+
const result = [...info.dirname.split("/"), info.name].filter(
|
|
354
|
+
(v) => v.length > 0
|
|
355
|
+
);
|
|
354
356
|
return result[result.length - 1] === "index" ? result.slice(0, -1) : result;
|
|
355
357
|
}
|
|
356
358
|
function loader(options) {
|