[Obsidian] Easy navigation of quarterly, monthly, weekly and daily notes with the help of Templater and Breadcrumbs plugins
I'd like to share how I made it easy to navigate quarterly, monthly, weekly and daily notes with the help of Templater and Breadcrumbs plugins.
Year:: [[2022]] Quarter:: [[2022-Q1]] Month:: [[2022-02]] Week:: [[2022-W05]] Prev:: [[2022-02-03]] Next:: [[2022-02-05]]And it's even crazier in the weekly notes because I put links to all daily notes of the week:
Year:: [[2022]] Quarter:: [[2022-Q1]] Month:: [[2022-02]] Days:: [[2022-01-31]], [[2022-02-01]], [[2022-02-02]], [[2022-02-03]], [[2022-02-04]], [[2022-02-05]], [[2022-02-06]] Prev:: [[2022-W04]] Next:: [[2022-W06]]
I soon found this approach a pain to maintain. Although I could auto-generate those links with the Templater plugin, I often accidentally messed up some fields while modifying or refactoring notes. So I came up with another solution that I find much neater. I'm documenting it in case others might find it useful.
This solution is powered by both the Templater plugin and the Breadcrumbs plugin.
First, I wrote a user script for Templater to generate a hierarchy note that contains a hierarchical list of links to all quarterly, monthly, weekly and daily notes of the year:
Then I configured the Breadcrumbs plugin to consume this hierarchy note. The Breadcrumbs plugin now renders this beautiful trail view at the top of every note, and a Matrix view at the side pane:
A limitation of this solution is that Breadcrumbs cannot tell which is the previous note and which is the next with just the hierarchy note, so I still keep these fields in the daily notes template, for example:
---
prev: [[<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>]]
next: [[<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>]]
---
Breadcrumbs can understand them and renders previous and next links in the trail view:
That's it! Now I can happily replace these links:
with these:
The same goes for weekly, monthly and quarterly notes. The text reduction for my weekly notes is even more significant since I used to put links to all 7 daily notes in every weekly note. Now I can navigate any day of the week via the Breadcrumbs Matrix view.
I like how simple and clean my inline fields have become and how easier it is to manage and maintain the relationships among these notes.
You might want to say that I can still accidentally mess up those prev and next fields. Yes, I agree, but I don't think that's a huge problem anymore since I still have the correct hierarchy note on top of all these notes to ensure the breadcrumbs are intact. And even if I messed up the hierarchy note, it's effortless to rebuild it with my Templater user script.
That's it! Now I can happily replace these links:
Year:: [[2022]] Quarter:: [[2022-Q1]] Month:: [[2022-02]] Week:: [[2022-W05]] Prev:: [[2022-02-03]] Next:: [[2022-02-05]]
with these:
--- prev: [[2022-02-03]] next: [[2022-02-05]] ---
The same goes for weekly, monthly and quarterly notes. The text reduction for my weekly notes is even more significant since I used to put links to all 7 daily notes in every weekly note. Now I can navigate any day of the week via the Breadcrumbs Matrix view.
I like how simple and clean my inline fields have become and how easier it is to manage and maintain the relationships among these notes.
You might want to say that I can still accidentally mess up those prev and next fields. Yes, I agree, but I don't think that's a huge problem anymore since I still have the correct hierarchy note on top of all these notes to ensure the breadcrumbs are intact. And even if I messed up the hierarchy note, it's effortless to rebuild it with my Templater user script.
Comments
Post a Comment