liamcain / obsidian-calendar-plugin

Simple calendar widget for Obsidian.
MIT License
1.64k stars 142 forks source link

Integration with Templater Plugin #189

Open dariuszkowalski-com opened 3 years ago

dariuszkowalski-com commented 3 years ago

Templater is a fantastic plugin for creating templates for Obsidian.

https://silentvoid13.github.io/Templater/

I can easily create daily notes with navigation directed to a next/ previous day notes

This is impossible to do in a standard template engine.

I would like to have the possibility to use templater templates with a calendar plugin.

konhi commented 3 years ago

This is impossible to do in a standard template engine.

It is possible with Calendar!

Using Templates core plugin

[[{{yesterday}}|<]] | {{date}} | [[{{tomorrow}}|>]] [[{{date -1d}|⬅]] | [[📓 My Journal]] | [[{{date +1d}}|➡]]

@liamcain I don't see this syntax documented in README nor Wiki. Do you think introducing it would be good idea?

obsidian_calendar

The problem is that it doesn't work while using Daily notes button, even on newest beta release.

@liamcain should this be fixed somehow? I'm sure many people use Daily notes as it is core plugin.

obsidian_calendar_bug

Using Templater

  1. Create journal template, it may look like this [[<% tp.date.now("YYYY-MM-DD", -1) %>|⬅]] | [[📓 My Journal]]| [[<% tp.date.now("YYYY-MM-DD", 1) %>|➡]]
  2. Set Daily Notes Template File Location to journal template image
  3. Turn on Trigger Templater on new file creation in Templater image

obsidian_calendar_templater

🎉

rafaelbressan commented 1 year ago

worked flawlessly the templater integration! thanks a ton!