From 3722e600ee3bd75130e4e228ea45c2074649329c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 28 Dec 2021 01:52:30 +0000
Subject: [PATCH] bump hugo-obsidian

---
 layouts/partials/graph.html |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html
index e8cd966..f089356 100644
--- a/layouts/partials/graph.html
+++ b/layouts/partials/graph.html
@@ -26,7 +26,6 @@
     while (depth >= 0 && wl.length > 0) {
       // compute neighbours
       const cur = wl.shift()
-      console.log(depth, cur, wl)
       if (cur === "__SENTINEL") {
         depth--
         wl.push("__SENTINEL")
@@ -34,7 +33,6 @@
         neighbours.add(cur)
         const outgoing = index.links[cur] || []
         const incoming = index.backlinks[cur] || []
-        console.log(incoming)
         wl.push(...outgoing.map(l => l.target), ...incoming.map(l => l.source))
       }
     }
@@ -148,7 +146,7 @@
     .attr("fill", color)
     .style("cursor", "pointer")
     .on("click", (_, d) => {
-      window.location.href = {{.Site.BaseURL}} + d.id.replace(" ", "-").replace("%20", "-");
+      window.location.href = {{.Site.BaseURL}} + decodeURI(d.id).replace(/[\s_]+/g, '-')
     })
     .on("mouseover", function (_, d) {
       d3.selectAll(".node")
@@ -206,7 +204,7 @@
   const labels = graphNode.append("text")
     .attr("dx", 12)
     .attr("dy", ".35em")
-    .text((d) => content[d.id.replace("%20", "-")]?.title || "Untitled")
+    .text((d) => content[decodeURI(d.id).replace(/[\s_]+/g, '-')]?.title || "Untitled")
     .style("opacity", 0)
     .style("pointer-events", "none")
     .call(drag(simulation));

--
Gitblit v1.10.0