Skip to content

Build your personal knowledge base with Trilium Notes

Filter excludeFromNoteMap from backlinks

sigaloidc85ec957ecf6
diff --git a/src/routes/api/note_map.js b/src/routes/api/note_map.js
index be07f3fe42..45b438d898 100644
--- a/src/routes/api/note_map.js
+++ b/src/routes/api/note_map.js
@@ -299,7 +299,7 @@ function getBacklinks(req) {
let backlinksWithExcerptCount = 0;
- return backlinks.map(backlink => {
+ return backlinks.filter(note => !note.getNote().hasLabel('excludeFromNoteMap')).map(backlink => {
const sourceNote = backlink.note;
if (sourceNote.type !== 'text' || backlinksWithExcerptCount > 50) {
diff --git a/src/routes/api/notes.js b/src/routes/api/notes.js
index bb49353035..d21addaadc 100644
--- a/src/routes/api/notes.js
+++ b/src/routes/api/notes.js
@@ -315,7 +315,7 @@ function getBacklinkCount(req) {
}
else {
return {
- count: note.getTargetRelations().length
+ count: note.getTargetRelations().filter(note => !note.getNote().hasLabel('excludeFromNoteMap')).length
};
}
}