mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-04 12:00:02 +00:00
allow hiding in graph
This commit is contained in:
parent
313dc50c95
commit
db6aded023
@ -35,7 +35,7 @@ function getGraph(data) {
|
||||
let links = [];
|
||||
let stemURLs = {};
|
||||
let homeAlias = "/";
|
||||
(data.collections.note||[]).forEach((v, idx) => {
|
||||
(data.collections.note || []).forEach((v, idx) => {
|
||||
let fpath = v.filePathStem.replace("/notes/", "");
|
||||
let parts = fpath.split("/");
|
||||
let group = "none";
|
||||
@ -47,14 +47,21 @@ function getGraph(data) {
|
||||
title: v.data.title || v.fileSlug,
|
||||
url: v.url,
|
||||
group,
|
||||
home: v.data["dg-home"] || (v.data.tags && v.data.tags.indexOf("gardenEntry") > -1)|| false,
|
||||
home:
|
||||
v.data["dg-home"] ||
|
||||
(v.data.tags && v.data.tags.indexOf("gardenEntry") > -1) ||
|
||||
false,
|
||||
outBound: extractLinks(v.template.frontMatter.content),
|
||||
neighbors: new Set(),
|
||||
backLinks: new Set(),
|
||||
noteIcon: v.data.noteIcon || process.env.NOTE_ICON_DEFAULT
|
||||
noteIcon: v.data.noteIcon || process.env.NOTE_ICON_DEFAULT,
|
||||
hide: v.data.hideInGraph || false,
|
||||
};
|
||||
stemURLs[fpath] = v.url;
|
||||
if (v.data["dg-home"] || (v.data.tags && v.data.tags.indexOf("gardenEntry") > -1)) {
|
||||
if (
|
||||
v.data["dg-home"] ||
|
||||
(v.data.tags && v.data.tags.indexOf("gardenEntry") > -1)
|
||||
) {
|
||||
homeAlias = v.url;
|
||||
}
|
||||
});
|
||||
|
@ -12,7 +12,9 @@
|
||||
const keys = Object.values(existing).map((n) => n.neighbors).flat();
|
||||
const n_remaining = Object.keys(remaining).reduce((acc, key) => {
|
||||
if (keys.indexOf(key) != -1) {
|
||||
existing[key] = remaining[key];
|
||||
if (!remaining[key].hide) {
|
||||
existing[key] = remaining[key];
|
||||
}
|
||||
} else {
|
||||
acc[key] = remaining[key];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user