A template that inserts another template based on file name.
Centralizes template settings across different plugins into one script, useful if you are using Templater, Periodic Notes, Unique note creator...etc, all at the same time.
Filename template can populate the correct template for daily/periodic notes, even if the note is created by clicking links.
- Copy
filename_template.md
to your Templater template folder location. - Modify
noteTypes
infilename_template.md
to configure template settings:format
: file name in momentjs format.template
: template for file whose name matchesformat
.
- Goto Templater settings and find Folder Templates
- Toggle Enable Folder Templates, then click Add New
- Set Folder to
/
, and Template tofilename_template.md
filename_template.md
will now be triggered whenever a new empty note is created, it will match note name with the format you specify, and insert the associated template.
- Call
tp.file.move()
in your template, and the new note will move to its designated location. - Match complex file path, such as
Project/YourProject/YourProject.md
, which is not possible with the built-in Templater features.