hauselin / obsidian-alfred

Alfred workflow for Obsidian note-taking app. Open vaults and files in Obsidian.
MIT License
500 stars 19 forks source link

Creating daily note using `od` doesn't expand variables in daily note template #39

Open wrtsprt opened 3 years ago

wrtsprt commented 3 years ago

My daily note template contains a variable for the date in the title

{{date:YYYY-MM-DD}}, {{date:dddd}}

When creating the daily note (first open of the day) using od the variable is not expanded. So instead of seeing the actual date of that day as a title I am seeing the expression above including the curly braces.

Obsidian: v0.12.15 Alfred workflow: v0.3.7

BTW same for usage of otmr.

hauselin commented 3 years ago

Unfortunately, this workflow doesn't handle the expansion right now. All it does is simply make a copy of your template. I'll consider implementing it in the future!

wrtsprt commented 3 years ago

Thanks for your answer. I am wondering if it would make sense to re-implement the expansion again in the plugin. Maybe there's a better way.

My current workaround will be using this plugin https://github.com/Vinzent03/obsidian-advanced-uri and triggering this URI obsidian://advanced-uri?vault=<my-vault>&daily=true. This does full expansion (and other plugin actions like TODO rollover).

hauselin commented 3 years ago

Thanks for the suggestions! For now, I'm not very keen on introducing dependencies since I want to avoid situations where this workflow breaks because a community plugin it depends on breaks for some reason.

Makes me wonder if a good compromise would be to simply open a blank daily note (if it doesn't already exist) and let users insert their own template manually. It's one extra step, but maybe it won't really be such a hassle?

avoll89 commented 2 years ago

@hauselin or @wrtsprt If I wanted to add the dependency using the advance URI plugin, how could I do that? I'd really love for my date variables to auto-populate because I have several task dataview lists that depend on the date populating.

wrtsprt commented 2 years ago

@hauselin or @wrtsprt If I wanted to add the dependency using the advance URI plugin, how could I do that? I'd really love for my date variables to auto-populate because I have several task dataview lists that depend on the date populating.

That's exactly what I am doing.

My current workaround will be using this plugin https://github.com/Vinzent03/obsidian-advanced-uri and triggering this URI obsidian://advanced-uri?vault=&daily=true. This does full expansion (and other plugin actions like TODO rollover).

Which part isn't clear here? Using the URL I mentioned above, with the plugin installed it does exactly that.

avoll89 commented 2 years ago

My current workaround will be using this plugin https://github.com/Vinzent03/obsidian-advanced-uri and triggering this URI obsidian://advanced-uri?vault=&daily=true. This does full expansion (and other plugin actions like TODO rollover).

Which part isn't clear here? Using the URL I mentioned above, with the plugin installed it does exactly that.

@wrtsprt Where exactly do you put the URI? In the dailyabspath, dailytempabspath, or dailytodaypath? Sorry, I'm extremely new to both Alfred and Alfred workflows, so I'm still figuring things out. I appreciate your reply!

ghost commented 2 years ago

@hauselin or @wrtsprt If I wanted to add the dependency using the advance URI plugin, how could I do that? I'd really love for my date variables to auto-populate because I have several task dataview lists that depend on the date populating.

That's exactly what I am doing.

My current workaround will be using this plugin https://github.com/Vinzent03/obsidian-advanced-uri and triggering this URI obsidian://advanced-uri?vault=&daily=true. This does full expansion (and other plugin actions like TODO rollover).

Which part isn't clear here? Using the URL I mentioned above, with the plugin installed it does exactly that.

How can i do that? I also have the same problem