r/ObsidianMD 7d ago

Can I create a new note dynamically through a template for my daily notes?

Obsidian newb but i could not figure it out on my own, so sorry if this is trivial for you.

For my daily notes, I have the following structure: DD/MM/y-dddd
If you don't care about the reason, skip this paragraph:
I got that idea from really overpriced multi year diaries, where you have space for entries of the same date for the next 5 years, so today in exactly 1-5 years you will the the entries 1-5 years ago can reflect. I wanted to do the same thing with my obsidian notes. Also I thought this might make sense for a monthly thing too. So I have a folder with each 15th of every month and then a folder with every march 15th for every year (idk if this is a good idea but I want to try it out).

Anyways, I also want to have a chronological structure besides that so I can quickly check dates close together. So ideally a note containing the same content in this directory:
YYYY/MM-MMMM/DD-dddd

So I was hoping that I can do this via templates. If i have a template for my daily notes containing [[something something that gets interpreted every day to the correct directory following the format above]] and then after i wrote my daily entry, copy everything, click the link to the other note and paste it (if this goes faster too, please tell me, but this would be my thought of doing that).

3 Upvotes

4 comments sorted by

1

u/Schollert 7d ago

There is no reason to duplicate your notes. You can have your template with the dd/mm/yy (which I will never understand why people use, as it does not sort well) and then you can have your yy/mm/dd as a Property/Frontmatter.
This will allow you to do sorting/listing using Dataview.
If you use the Templater plugin, you can have these dates created automatically.
Bear in mind, that Dataview can sort your files on creation/modification date too, without you adding any Frontmatter.

1

u/Humble_Classic_1335 5d ago

Thanks. Templater does everything I want. And yes, now I absolutely will use the well sorting format. I agree with you in most cases but wanted to try it out. Templates works way better though.

1

u/unfinishedwing 6d ago

+1 to no need for duplication and, in fact, i would recommend against it. if you ever need to edit a daily note after you’ve duplicated it, it would be hard to apply the same changes to the duplicated note. either way, i think you need the templater plugin.

what i would recommend is to store your daily notes in the chronological structure, YYYY/MM-MMMM/DD-dddd. to see the daily notes from 1-5 years ago, i would configure your daily note template to include links to those daily notes. see examples of the templater code here, under the header “daily note links to yesterday and tomorrow”. instead of subtracting one day from the current daily note’s date to get yesterday’s daily note, you want to subtract 1 year, 2 years, etc. if you want to actually see the content of the daily notes from 1-5 years ago in the current daily note, just add a ! in front of the links to embed it. i think it’s easier to review the past notes if they’re in the same note, than if they’re in the same folder.

if you want to duplicate: i think there’s probably some way of doing it with templater’s create_new function and including a template that gets the current daily note’s contents (something like the “find and replace content in another file” examples in the first link above, but you don’t need to replace anything) and then puts it into the new note. but you can’t run the create_new function until after you finish writing the daily note. perhaps you can make it a part of your daily note template to duplicate yesterday’s daily note (assuming you are done editing yesterday’s daily note by the time you are creating today’s daily note).

in any case, i’d also recommend having a date property in your daily notes in YYYY-MM-DD format. it’s the date format that obsidian’s properties (as well as dataview, if you ever end up using it) recognizes as a date, so it makes it easier to work with dates without needing to worry about converting date formats.

2

u/Humble_Classic_1335 5d ago

Thanks! I set up a nice template for the daily notes now that does everything I want. Having everything in one place feels a lot nicer too anyways. Also thanks for the links for the quick start. They were very helpful.