From 7a80cc0510e4e17898d583fdcb578dda6f25127c Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Tue, 3 May 2022 08:53:18 -0700 Subject: [PATCH 1/4] Fix active node on graph --- assets/js/graph.js | 4 ++-- data/config.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/graph.js b/assets/js/graph.js index c5829e92..c32035d8 100644 --- a/assets/js/graph.js +++ b/assets/js/graph.js @@ -1,5 +1,5 @@ async function drawGraph( - url, + _url, baseUrl, pathColors, depth, @@ -10,7 +10,7 @@ async function drawGraph( const container = document.getElementById('graph-container') const { index, links, content } = await fetchData - const curPage = url.replace(baseUrl, '') + const curPage = window.location.href.replace(baseUrl, '').slice(0, -1) const parseIdsFromLinks = (links) => [ ...new Set(links.flatMap((link) => [link.source, link.target])), diff --git a/data/config.yaml b/data/config.yaml index afa531c3..2676ac2a 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -3,7 +3,7 @@ enableToc: true openToc: false enableLinkPreview: true enableLatex: true -enableSPA: false +enableSPA: true description: Host your second brain and digital garden for free. Quartz features extremely fast full-text search, Wikilink support, backlinks, local graph, tags, and link previews. From 8d105ce68f897817c04cd4a433e8958cd50206bf Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Tue, 3 May 2022 09:20:01 -0700 Subject: [PATCH 2/4] Remove unnecessary 'url' param in drawGraph --- assets/js/graph.js | 1 - layouts/partials/head.html | 1 - 2 files changed, 2 deletions(-) diff --git a/assets/js/graph.js b/assets/js/graph.js index c32035d8..e92f7db6 100644 --- a/assets/js/graph.js +++ b/assets/js/graph.js @@ -1,5 +1,4 @@ async function drawGraph( - _url, baseUrl, pathColors, depth, diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 37938a55..93051cb9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -75,7 +75,6 @@ container.textContent = ""; drawGraph( - {{strings.TrimRight "/" .Page.Permalink}}, {{strings.TrimRight "/" .Site.BaseURL}}, {{$.Site.Data.graphConfig.paths}}, {{$.Site.Data.graphConfig.depth}}, From 018c55bd999b9fae789f022226dfc0ba7e3944b7 Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Tue, 3 May 2022 09:22:51 -0700 Subject: [PATCH 3/4] Remove unnecessary 'url' argument in graph.html --- layouts/partials/graph.html | 1 - 1 file changed, 1 deletion(-) diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index b8b2f616..6bc77b64 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -18,7 +18,6 @@