liamcain / obsidian-periodic-notes

Create/manage your daily, weekly, and monthly notes in Obsidian
MIT License
993 stars 68 forks source link

[BUG] "Open Daily Note on Startup" does not properly process Templater at startup for obsidian version v1.7.4 #237

Open Harimus opened 1 month ago

Harimus commented 1 month ago

Hi, I recently updated my Obsidian to v1.7.4 on Ubuntu 20.04.

After the update, I noticed that my Periodic Notes Plugin started to behave weirdly. Every time I open Obsidian, it is supposed to open/create the daily notes, since I have "open daily note on startup" configured in "Daily Notes" Core Plugin. The daily note includes Templater scripts to generate the Daily note as I want.

However, the templater scripts remain unprocessed when the file is created this way.

First, I thought maybe I accidentally deleted something and there was an syntax error on Templater scripts, but after deleting the faulty daily note and opening/creating it again with command (Ctrl + P) "Daily Notes: Open today's daily Notes" The daily note was created correctly with Templater.

I'm not sure if this is Obsidian side bug, or plugin side bug (Templater or periodic-notes)..

For reference, The templater code that doesn't get processed look like these

<<[[DailyWeeklyNotes/DailyNotes/<%* if (tp.date.now("ddd", 0, tp.file.title, "YYYY-MM-DD-dddd") == "Mon") { %><% tp.date.now("YYYY/MM/YYYY-MM-DD-dddd", -3) %> | Last Friday]]<%* } else { %><% tp.date.now("YYYY/MM/YYYY-MM-DD-dddd", -1) %>| Yesterday]] <%* } %>   | [[DailyWeeklyNotes/DailyNotes/<%* if (tp.date.now("ddd", 0, tp.file.title, "YYYY-MM-DD-dddd") == "Fri") { %><% tp.date.now("YYYY/MM/YYYY-MM-DD-dddd", +3) %> |Next Monday]]<%* } else { %><% tp.date.now("YYYY/MM/YYYY-MM-DD-dddd", +1) %> |Tomorrow]]<%* } %> >> 

![[DailyWeeklyNotes/WeeklyNotes/<% tp.date.now("gggg-[W]ww", 0) %>#Todo]]