Daily notes: Allow formatting file location (subfolders based on year/month)

Use case or problem

I’m keeping a daily journal and my files are in a structure like this: journal/YYYY/MM/YYYY-MM-DD.md. Currently, I’m using a custom bash script to create the daily file via Alfred, but it would be awesome to have Obsidian’s daily notes plugin support this natively.

Proposed solution

Allow formatting the “New file location” with year and month. Also the folder would have to be created if needed in case it’s the first entry for the current month. (Currently, when the folder specified in “New file location” does not exist, there will be an error.)

Current workaround (optional)

Using a bash script to create the appropriate file for the day and open it in Obsidian.

Related feature requests (optional)

7 Likes

I thought maybe Periodic Notes plugin was the answer, but I’m not sure if it works with folders in the same way you are describing.

See Periodic Note’s Readme, under the FAQ question “How do I use a variable in the folder path?”: GitHub - liamcain/obsidian-periodic-notes: Create/manage your daily, weekly, and monthly notes in Obsidian

I’m a bit late here, but I found out you can do this by putting the folder pattern in the “Date format” instead of under “New file location” - the format will get expanded, appended to the new file location, and all directories between the two will be created.

For example, here’s my config:
Date format: YYYY/MM/YYYY-MM-DD dd
New file location: logs/

Which created logs/2022/11/2022-11-17 Th today.

The same thing also works for unique notes by putting the date-dependent path in the “Unique prefix format” configuration.

Reference

3 Likes

I am using daily notes as diary. Given 79 years average life span and 60 years active journaling, daily notes can be used for 21900 files. A lot for one folder. Hence I also needed this feature for patterns for subfolders and found this thread with the solution.

I would have a favour to ask to the maintainers of daily note core plugin: could you please do the following documentation change (emphasized font below)?

(using my format & path as example):

Date format:

For more syntax, refer to: format reference
Your current syntax looks like this: 2023/06/2023-06-21
Use “/” to place notes in subfolders.
[ YYYY/MM/YYYY-MM-DD ]

New file location

New daily notes will be placed here within:
[ diary/ ]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.