mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
Remove duplicates in graph
This commit is contained in:
parent
21b9897782
commit
dede9d091d
@ -32,6 +32,8 @@
|
||||
return x;
|
||||
});
|
||||
|
||||
const outboundDuplicatesRemoved = outbound.filter(x=>!backLinks.find(b=>b.url === x.url));
|
||||
|
||||
const title = "{{page.fileSlug}}" || "Home"
|
||||
const currentNode = {
|
||||
title,
|
||||
@ -41,12 +43,13 @@
|
||||
|
||||
const gData = {
|
||||
nodes: [
|
||||
currentNode, ...backLinks,
|
||||
...outbound
|
||||
currentNode,
|
||||
...backLinks,
|
||||
...outboundDuplicatesRemoved
|
||||
],
|
||||
links: [
|
||||
...backLinks.map(backlink => ({source: backlink.id, target: 0})),
|
||||
...outbound.map(outlink => ({source: 0, target: outlink.id}))
|
||||
...outboundDuplicatesRemoved.map(outlink => ({source: 0, target: outlink.id}))
|
||||
]
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user