fumadocs-core 13.3.2 → 13.4.0

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.
@@ -13,7 +13,7 @@ function parseFilePath(path) {
13
13
  const dotIdx = base.lastIndexOf(".");
14
14
  const nameWithLocale = dotIdx !== -1 ? base.slice(0, dotIdx) : base;
15
15
  const flattenedPath = [dirname, nameWithLocale].filter((p) => p.length > 0).join("/");
16
- const [name, locale] = nameWithLocale.split(".");
16
+ const [name, locale] = getLocale(nameWithLocale);
17
17
  return {
18
18
  dirname,
19
19
  name,
@@ -25,7 +25,7 @@ function parseFilePath(path) {
25
25
  function parseFolderPath(path) {
26
26
  const segments = splitPath(slash(path));
27
27
  const base = segments.at(-1) ?? "";
28
- const [name, locale] = base.split(".");
28
+ const [name, locale] = getLocale(base);
29
29
  const flattenedPath = segments.join("/");
30
30
  return {
31
31
  dirname: segments.slice(0, -1).join("/"),
@@ -35,6 +35,13 @@ function parseFolderPath(path) {
35
35
  path: flattenedPath
36
36
  };
37
37
  }
38
+ function getLocale(name) {
39
+ const sep = name.lastIndexOf(".");
40
+ if (sep === -1) return [name];
41
+ const locale = name.slice(sep + 1);
42
+ if (/\d+/.exec(locale)) return [name];
43
+ return [name.slice(0, sep), locale];
44
+ }
38
45
  function normalizePath(path) {
39
46
  const segments = splitPath(slash(path));
40
47
  if (segments[0] === "." || segments[0] === "..")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "13.3.2",
3
+ "version": "13.4.0",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",