Nice. Do you manually replace the YYYYMMDD part with the appropriate dates on each note, or are you able to automate that somehow?
I use a different approach now dude, but Iām pretty sure it populates if you have a few of the correct plugins. Maybe templater? Not sure, Iām green on this stuff
Ah, ok. Iāll poke around a bit and see if I can get it working. Thanks!
Templater lets you insert the correct previous/next dates for future days.
I think core now does yesterday and today. Not sure if thatās also for future days.
Hi @EleanorKonik , Thank you for these. Some of your ideas have completely changed the way I think! Very grateful.
I was playing around the CLI javascript to collate text from a specific heading in daily notes. And ran into multiple errors. I am a noob when it comes to any programming, so just thought Iād check if the script youāre using still works for you. Also, I know you said you might do a plugin at some point. Is this still on teh cards? Thank you again.
Thank you! Much appreciated.
Eleanor, thanks for sharing your expertise!
Iāve implemented this snippets to link todayās note to yesterday and tomorrow, it works well when linking to an already created note, for how I use these links typically this is the āyesterdayā note. However when I click on ātomorrowā hence creating the new note, this doesnāt come with the expected template associated for daily note.
I have had this issue for so long that I now feel motivated to solve it hope you can share some directions! thanks
If youāre using either the core Daily Notes plugin, or the Periodic Notes plugin, you can map hotkeys to āOpen daily noteā, āOpen previous daily noteā, and āOpen next daily noteā:
Using this command/hotkey will skip days you donāt have notes for. I donāt often write on weekends, so this is much more preferable to me than constantly updating broken links.
I was referring to this snippet not working for uncreated note
ā [[{{date-1d:YYYYMMDD}}]] [[{{date+1d:YYYYMMDD}}]] ā
My bad. I read too fast and thought that you did not want to see the notes that were not created. AFAIK the only way to automatically use a template is with the Daily note or Zettelkasten plugin.
Some time ago there was lots of talk around a way to add a specific template to any new note, but if a plugin was ever developed, I donāt know of it.
Last thought, although itās still a workaround - the calendar plugin, coupled with periodic notes, allows for a designated template to be used when clicking on a specific day. The nice thing is that the date parsing is done as if you were adding the note on the day you clicked, so things like your snippet would still work in the way youād expect without modifying them manually.
---
<%*
const title = tp.file.title;
const yesterday = moment(title).subtract(1, 'days').format("YYYY-MM-DD");
const today = moment(title).format("YYYY-MM-DD");
const tomorrow = moment(title).add(1, 'days').format("YYYY-MM-DD");
-%>
---
# [[<% yesterday %>|ā]] <% today %> [[<% tomorrow %>|ā]]
This works with stuff like the Review plugin, Iām not sure if itāll do exactly what you want, but it should get you closer.
no worries, it give me a chance to explain myself better, in fact Iām really confused about whatās happening.
Iām familiar with what you wrote in the last paragraph, the issue Iām pointing at is related to this, when I click on tomorrow (before having created the new note from the calendar), ātomorrowā note is created without the correct template. However, if I create the note from the calendar and then go back to ātodayā's note and click on ātomorrowā everything work as expected. Iām starting to realise that this is a standard behaviour, since in the first scenario, Obsidian is receiving no instructions about what template to apply, whereas in the 2nd yes, through the plugin settings. Any thoughts?
Yes, you have things correct.
Creating a note from a plugin can trigger a template, but clicking a link, CTRL+N
, or using the āCreate a new noteā button will not.
Iām pretty sure the Templater plugin has a setting to do this, but Iāve never tried it. Try this setting:
Note that this is not just daily notes, but all new files. I thought sure someone had a plugin that could pick a template based on the fileās folder location, but Iām not seeing it.
Good luck!
Hi,
Does that work on mobile?
When I insert your code in my daily note template I dont get your resultā¦ are there any special templater configs necessary?
Thanks in advance!
templater does have that option. Look at the Folder Templates setting of the templater plugin
Thank you! This looks great and works perfectly.