fumadocs-core 12.1.1 → 12.1.2

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.
@@ -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 ? [...splitPath(baseUrl), locale, ...slugs] : [...splitPath(baseUrl), ...slugs];
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 = [...splitPath(info.dirname), info.name];
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "12.1.1",
3
+ "version": "12.1.2",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",