I have been using templates to add recurrent tasks to my daily journal in Obsidian.
This won’t be long, and should be easy for Obsidian nerds. I combine two plugins:
Templater, to have powerful templates. Make sure to read how to use it (TL;DR: create files in a template folder you configure only for the plugin, and this is important).
Calendar, to have an easy way to go to today or any day.
Additionally, it can be useful to have the Periodic Notes plugin: it is from the same author as Calendar, and lets you have weekly, monthly and even quarterly “master notes”.
The only additional setup you need is enabling Trigger Templater on new file creation, so the template runs when you create a daily note. Beware, if you write “pseudo-templates” in the wrong directory, they will be ruined by this setting.
My master “journal” template file looks like this:
I track (approximately) how much I have spent in bed and how energetic I felt in the morning in the metadata of the file. The file has only the current date, and I usually add a “fun” or descriptive title (like “The day all jobs failed”) to remember better what happened.
All these include statements are from Templater’s internal methods, these inline all these files. Each one is a template on its own, with Random-quote being, probably, the most useful:
let tf = app.metadataCache.getFirstLinkpathDest("Daily quote", "")
let contents = await app.vault.read(tf)
let nonEmpty = contents.split("\n").filter(c=>c!="")
let randomQuote = nonEmpty[Math.floor(Math.random()*nonEmpty.length)]
> <% randomQuote %>
This template uses the internal Obsidian API as exposed from Templater, finding a file named Daily quote, reading it and picking a (non-empty) line from it. It then adds it as a quote.
The other templates are specific repetitions: things I may want to do on particular weekdays, or on particular days of the month.
This is just a reminder to check the backlog and current sprint, as well as add a post from my list of pending-posts-to-read (those you see from time to time in Readings). That one filters only “task elements”, since I also have Tracker graphs in my pending lists (if you are curious ask me on twitter).
The magic incantation on the first if is parsing the created file name, and formatting it as day-of-the-week. If the format you use in the Calendar plugin is not YYYYMMDD you need to change this.
If it’s Sunday, I may write the Readings post, watch a random (probably techie)
video and also do a GTD-style weekly review. But on alternating weeks I will recharge all my headphones (and water the plant I have close to my work desktop) or clean and recharge trackball & keyboard.
This is not 100% ideal, since it will wrap-around badly on years with an odd number of weeks, but this is not that critical, and I can just change the template if needed before year’s end.
-% (or %-) is one of the several commands used to control whitespace around templates in Templater (see Section Whitespace Control in the documentation). This one in particular removes a newline after the template (or before). I use it to make sure task lists have no extraneous empty lines among them.