From 94e987dab5a50196bc2273addc6f908178abd0fb Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 15 Mar 2022 07:37:56 +0000
Subject: [PATCH] feat: better titles for empty pages #61

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

diff --git a/assets/js/graph.js b/assets/js/graph.js
index c6c8718..6a63024 100644
--- a/assets/js/graph.js
+++ b/assets/js/graph.js
@@ -129,7 +129,7 @@
     .on("click", (_, d) => {
       window.location.href = baseUrl + '/' + decodeURI(d.id).replace(/\s+/g, '-')
     })
-    .on("mouseover", function (_, d) {
+    .on("mouseover", function(_, d) {
       d3.selectAll(".node")
         .transition()
         .duration(100)
@@ -159,7 +159,7 @@
         .transition()
         .duration(200)
         .style("opacity", 1)
-    }).on("mouseleave", function (_, d) {
+    }).on("mouseleave", function(_, d) {
       d3.selectAll(".node")
         .transition()
         .duration(200)
@@ -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 || "Untitled")
+    .text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || d.id.replace("-", " "))
     .style("opacity", 0)
     .style("pointer-events", "none")
     .call(drag(simulation));

--
Gitblit v1.10.0