From ef72f1bf707dca363cdab84da91e2acfaef8f276 Mon Sep 17 00:00:00 2001
From: Ammar Alakkad <am.alakkad@gmail.com>
Date: Mon, 30 Dec 2024 16:03:57 +0000
Subject: [PATCH] Fix ObsidianFlavoredMarkdown source link (#1694)
---
quartz/components/Explorer.tsx | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx
index cffc079..ec7c48e 100644
--- a/quartz/components/Explorer.tsx
+++ b/quartz/components/Explorer.tsx
@@ -44,12 +44,9 @@
// memoized
let fileTree: FileNode
let jsonTree: string
+ let lastBuildId: string = ""
function constructFileTree(allFiles: QuartzPluginData[]) {
- if (fileTree) {
- return
- }
-
// Construct tree from allFiles
fileTree = new FileNode("")
allFiles.forEach((file) => fileTree.add(file))
@@ -76,12 +73,17 @@
}
const Explorer: QuartzComponent = ({
+ ctx,
cfg,
allFiles,
displayClass,
fileData,
}: QuartzComponentProps) => {
- constructFileTree(allFiles)
+ if (ctx.buildId !== lastBuildId) {
+ lastBuildId = ctx.buildId
+ constructFileTree(allFiles)
+ }
+
return (
<div class={classNames(displayClass, "explorer")}>
<button
@@ -91,8 +93,10 @@
data-collapsed={opts.folderDefaultState}
data-savestate={opts.useSavedState}
data-tree={jsonTree}
+ aria-controls="explorer-content"
+ aria-expanded={opts.folderDefaultState === "open"}
>
- <h1>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h1>
+ <h2>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h2>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
--
Gitblit v1.10.0