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;
|
return x;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const outboundDuplicatesRemoved = outbound.filter(x=>!backLinks.find(b=>b.url === x.url));
|
||||||
|
|
||||||
const title = "{{page.fileSlug}}" || "Home"
|
const title = "{{page.fileSlug}}" || "Home"
|
||||||
const currentNode = {
|
const currentNode = {
|
||||||
title,
|
title,
|
||||||
@ -41,12 +43,13 @@
|
|||||||
|
|
||||||
const gData = {
|
const gData = {
|
||||||
nodes: [
|
nodes: [
|
||||||
currentNode, ...backLinks,
|
currentNode,
|
||||||
...outbound
|
...backLinks,
|
||||||
|
...outboundDuplicatesRemoved
|
||||||
],
|
],
|
||||||
links: [
|
links: [
|
||||||
...backLinks.map(backlink => ({source: backlink.id, target: 0})),
|
...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