srg-kostyrko / obsidian-journal

MIT License
70 stars 7 forks source link

Disable Templater on new note creation? #29

Closed LemurTech closed 2 weeks ago

LemurTech commented 4 months ago

Am I right that I have to disable Templater on new note creation if I want this plugin to work correctly? Even without folder templates active, if I have Templater enabled on new note creation, the Journals frontmatter entries get overwritten by Templater. I can see they are briefly there, and then they are gone!

Do I really have to choose, or am I just doing something wrong?

srg-kostyrko commented 4 months ago

There is a delay (1s) before plugin injects frontmatter - this is to allow templater to inject content with on new note creation enabled. It worked fine when I tested on simple templates. But probably in your case it takes more time than this delay for temaplater to process template.

I plan to add fullfledged support for templater templates (so that templates can be selected in plugin settings) - but this is couple weeks at least till I get to it.

Looks like for now it would be better to disable on new note creation in templater and apply template manually. Sorry for this inconvenience.

LemurTech commented 4 months ago

Hey, thank you for that hint. I found the delay constant FRONTMATTER_ADDING_DELAY in the code and extended it from 800ms to 1500ms. I found that this is working for me, at least for the moment!

srg-kostyrko commented 3 months ago

@LemurTech in 1.3.0 templater support was improved so that you can select Templater templates in plugin settings (plugin will use Templater under the hood to process templates) check https://github.com/srg-kostyrko/obsidian-journal#templater-caveeats on how to adjust setting to avoid problems with templater interfering