Skip to content

Latest commit

 

History

History

Filename Template

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Filename Template

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 Demo

Filename template can populate the correct template for daily/periodic notes, even if the note is created by clicking links.

Requirement

Plugins

How to use

  1. Copy filename_template.md to your Templater template folder location.
  2. Modify noteTypes in filename_template.md to configure template settings:
    1. format: file name in momentjs format.
    2. template: template for file whose name matches format.

Set as Default Template

  1. Goto Templater settings and find Folder Templates
  2. Toggle Enable Folder Templates, then click Add New
  3. Set Folder to /, and Template to filename_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.

You can also...

  • 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.