diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx index 3c967624b..d5c34dd2a 100644 --- a/quartz/components/Explorer.tsx +++ b/quartz/components/Explorer.tsx @@ -147,7 +147,7 @@ export default ((userOpts?: Partial) => { -
+
  • diff --git a/quartz/components/ExplorerNode.tsx b/quartz/components/ExplorerNode.tsx index 88246e049..9b3080fc1 100644 --- a/quartz/components/ExplorerNode.tsx +++ b/quartz/components/ExplorerNode.tsx @@ -134,8 +134,11 @@ export class FileNode { const traverse = (node: FileNode, currentPath: string) => { if (!node.file) { const folderPath = joinSegments(currentPath, node.name) + const collapseState = !currentFile.includes( + folderPath.replace("'", "-").replaceAll("../", ""), + ) if (folderPath !== "") { - folderPaths.push({ path: folderPath, collapsed }) + folderPaths.push({ path: folderPath, collapsed: collapseState || collapsed }) } node.children.forEach((child) => traverse(child, folderPath))