From e62d512d95bc52f3113cae5e3763665364fa7c72 Mon Sep 17 00:00:00 2001
From: meleu <meleu.dev@gmail.com>
Date: Sun, 03 Apr 2022 19:29:10 +0000
Subject: [PATCH] disable ToC if frontmatter has "enableToc: false"

---
 assets/js/graph.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/assets/js/graph.js b/assets/js/graph.js
index 6a63024..f0b1f7f 100644
--- a/assets/js/graph.js
+++ b/assets/js/graph.js
@@ -185,7 +185,7 @@
   const labels = graphNode.append("text")
     .attr("dx", 12)
     .attr("dy", ".35em")
-    .text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || d.id.replace("-", " "))
+    .text((d) => content[d.id]?.title || d.id.replace("-", " "))
     .style("opacity", 0)
     .style("pointer-events", "none")
     .call(drag(simulation));

--
Gitblit v1.10.0