Automatically insert templates by file name

Filename Template - GitHub

demo

The Problem

My periodic notes contains links to future notes which are non-existence. Clicking through them won’t trigger Periodic Notes to insert templates for me, resulting in a blank note, which is less than ideal.

This is where Filename Templates comes in, same as the Folder Templates feature of Templater, but instead of detecting folder location, it detects file names.

How it Works

Filename Templates detects file names, for example, if a file name matches YYYY-MM-DD format, it inserts daily.md into the new note.

Tips and Tricks

  • You can modify the template to match file names against regex, or complex path/filename combinations
  • Utilize tp.file.move() in periodic templates, and they will be automatically sorted into your designated folder
1 Like