I am trying out Obsidian from a TiddlyWiki background. I am used to my “tiddlers” (obsidian notes) having the following fields associated with them:
title:
created:
modified:
tags:
I have been using the Templater plugin to place this YAML block on top of all of my notes (It would be great if this was automatic, but I posted about that in another topic).
I’d like to make sure I understand something about how Obsidian+Templater works. When this template is “pasted in”/“applied”, Templater will calculate these times and place them in automatically for me.
However - this is only ever done once, unless I go ahead and apply template again myself. So future modifications will not cause the modified time to be updated.
In other words, there is no way to automatically have these fields updated.
If I we’re to do this on a Mac I would use Hazel to watch for changes, then run a script when triggered that updates the text based on the file modification date.
Ive updated my post to reflect Im running on Mac. I see thanks for the suggestion. I just want to make sure this can’t be accomplished inside Obsidian itself.
File Last Modif Date: <% tp.file.last_modified_date() %>
File Last Modif Date with format: <% tp.file.last_modified_date(“dddd Do MMMM YYYY HH:mm”) %>
You should be able to make the last modified date automatically update by putting “<%+” instead of “<%” at the start of the commands.
This is extremely confusing and fiddly, but the “+” sign here indicates a dynamic command. If you have just “<%” it will immediately put in a date and that’ll never change to reflect later modifications. With the “+” though it should update itself with the last modified date every time you change to preview mode.
It kind of works, basically. For some reason it doesn’t work on mine right now, I don’t know why, I don’t have 5 hours to fuss with it. But it’s worked for me in the past, just been a couple of weeks since I messed with this stuff and I forget exactly what you have to do to get this crap to work.
Unfortunately documentation for this stuff is just a pain in the butt to sort out. But you can probably get this going if you fiddle around with it for a while.
Thanks for the tips. I think I’m running into this.
To start: Templates and Templater, both turned on. I know the syntax for Templates + Templater is different, so different template files. I know the Template + Templater have different commands for ‘Insert Template’.
I did look here: https://silentvoid13.github.io/Templater/docs/commands/dynamic-command/ Maybe something simple, but with the + added to the modification date, the code is always there. Even if I close and reopen the note. Do I mis-understand the refresh problems section? Any idea what I’m doing wrong?