Skip to content

Commit

Permalink
feat(Path View): ✨ Show "Index Note" instead of noPathFoundMessage wh…
Browse files Browse the repository at this point in the history
…en active note is an indexNote (fix #220)
  • Loading branch information
SkepticMystic committed Dec 29, 2021
1 parent df3b148 commit 40b2ceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/BreadcrumbsSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export class BCSettingTab extends PluginSettingTab {
new Setting(trailDetails)
.setName("Index Note(s)")
.setDesc(
"The note that all of your other notes lead back to. The parent of all your parent notes. Just enter the name. So if your index note is `000 Home.md`, enter `000 Home`. You can also have multiple index notes (comma-separated list). The breadcrumb trail will show the shortest path back to any one of the index notes listed. You can now leave this field empty, meaning the trail will show a path going as far up the parent-tree as possible."
"The note that all of your other notes lead back to. The parent of all your parent notes. Just enter the basename. So if your index note is `000 Home.md`, enter `000 Home`. You can also have multiple index notes (comma-separated list). The breadcrumb trail will show the shortest path back to any one of the index notes listed. You can now leave this field empty, meaning the trail will show a path going as far up the parent-tree as possible."
)
.addText((text) => {
text
Expand Down
9 changes: 6 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,9 +1500,7 @@ export default class BCPlugin extends Plugin {
);
} else {
view = activeMDView.contentEl.querySelector("div.markdown-source-view");
if (view.hasClass("is-live-preview")) {
livePreview = true;
}
if (view.hasClass("is-live-preview")) livePreview = true;
}

activeMDView.containerEl
Expand Down Expand Up @@ -1579,6 +1577,11 @@ export default class BCPlugin extends Plugin {
}

trailDiv.empty();
if (settings.indexNotes.includes(basename)) {
trailDiv.innerText = "Index Note";
db.end2G();
return;
}

if (noItems) {
trailDiv.innerText = noPathMessage;
Expand Down

0 comments on commit 40b2ceb

Please sign in to comment.