If your daily notes template has links to yesterday’s and tomorrow’s daily notes, then it’s possible you’ve run into the issue where clicking on a date in the Calendar plugin will apply your template, but clicking on links to yesterday’s and tomorrow’s notes will not apply your template.
If this is the case, you can solve this with the folder templates feature of the Templater plugin.
Turn on folder templates
In Templater settings, setup the following settings.
- “Trigger Templater on new file creation” toggled on.
- “Enable folder templates” toggled on.
- Add new folder template(s).
- Add your folder template here. The left input is where you’ll set the folder where you want the template to be applied. The right input is for the template that will be applied to new notes in that folder.
Here’s what my folder template settings look like.
Include full path to daily note in link
When clicking on a link to a note that doesn’t exist, Obsidian will create the note based on the “default location for new notes” setting. You can override this by including the path to the note in the link. For example, clicking on a link formatted as [[2023-05-04]]
will create a new note in the default location, but [[Daily Notes/2023-05-04]]
will create a new note in the “Daily Notes” folder.
Here is an example of a Templater snippet for a link to yesterday and tomorrow that includes the folder. You can find other examples on my Templater snippets page.
<%*
const linkFormat = '[Daily Notes]/YYYY-MM-DD';
const yesterday = tp.date.now(linkFormat, -1, tp.file.path(true), linkFormat);
const tomorrow = tp.date.now(linkFormat, 1, tp.file.path(true), linkFormat);
-%>
[[<% yesterday %>]] | [[<% tomorrow %>]]
Other potential settings to change
If the above doesn’t work, try adjusting the following settings.
- Clear the “Template file location” setting for the Daily Notes plugin.
- Disable the Templates core plugin. This plugin could potentially conflict with the Templater community plugin.
Conclusion
And that’s it! You should now be able to click on links to yesterday’s and tomorrow’s daily notes and have your daily notes template applied.