From 9e2a21e0f3c8819ff8f9214f1718d8bb517c63b8 Mon Sep 17 00:00:00 2001 From: "turtton(watagame)" Date: Sun, 3 Mar 2024 19:16:10 +0900 Subject: [PATCH] fix: Duplicated folder in TreeView sometime crashes render (#66) --- src/lib/markdown.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/markdown.ts b/src/lib/markdown.ts index 68675905..c260bf33 100644 --- a/src/lib/markdown.ts +++ b/src/lib/markdown.ts @@ -1,4 +1,5 @@ import { DirectoryTree } from "directory-tree"; +import { getMarkdownFolder } from "./io"; import { getRouterPath } from "./slug"; export interface TreeData { @@ -16,7 +17,7 @@ export function convertTreeData(thisObject: DirectoryTree): TreeData { const newObject: TreeData = { name: objectName.replace(".md", ""), children, - id: routerPath ?? objectName, + id: thisObject.path.replace(getMarkdownFolder(), ""), routePath: routerPath, };