Obsidian Templater Plugin

The {{tp_title}} internal template returns the base filename, but having to remove the dashes from the filename kind of defeats the purpose of a lazy frontmatter generation template.

Took me way longer than strictly necessary to figure the below custom template out:

powershell (\"{{note_title}}\" -replace \"-\", \" \")

(all quotes must be escaped!)

Default Internal Templates

Internal TemplateArgumentsDescriptionExample Output
{{tp_title}}NoneRetrieves the active file name.MyFile
{{tp_folder}}- vault_path: Appends the vault relative path to the folder name. Takes true or false as a value (default: false).Retrieves the folder name in which the active file is.Permanent Notes
{{tp_include}}- f: The relative path from the vault root of the file to include.Includes the file content. This file can be another template file, templates will be resolved recursively (Max inclusion depth: 10)My header for all files
{{tp_date}}- f: Format for the date, refer to format reference (default: YYYY-MM-DD).
- offset: Offset for the day, for example you can set this to -7 to get last week’s date (default: 0).
Retrieves today’s date + the date offset argument if given2021-01-15
{{tp_yesterday}}- f: Format for the date, refer to format reference (default: YYYY-MM-DD).Retrieves yesterday’s date.2020-11-05
{{tp_tomorrow}}- f: Format for the date, refer to format reference (default: YYYY-MM-DD).Retrieves tomorrow’s date in the format.2020-11-07
{{tp_time}}- f: Format for the time, refer to format reference (default: HH:mm).Retrieves the current time.08:36
{{tp_creation_date}}- f: Format for the date, refer to format reference (default: YYYY-MM-DD HH:mm).Gets the creation date of the active file.2021-01-06 20:27
{{tp_last_modif_date}}- f: Format for the date, refer to format reference (default: YYYY-MM-DD HH:mm).Gets the last modification date of the active file.2020-11-08 12:31
{{tp_title_date}}- title_f: Date format of the title, refer to format reference (default: YYYY-MM-DD). You want this argument to be the same as the daily note core plugin format setting.
- f: Format for the date, refer to format reference (default: YYYY-MM-DD).
- offset: Offset for the day, for example you can set this to -7 to get the date minus 7 days (default: 0).
Retrieves the date from the file’s title date referential + the date offset argument if given.2021-01-16
{{tp_title_yesterday}}- title_f: Date format of the title, refer to format reference (default: YYYY-MM-DD). You want this argument to be the same as the daily note core plugin format setting.
- f: Format for the date, refer to format reference (default: YYYY-MM-DD HH:mm).
Retrieves yesterday’s date from the file’s title date referential.2021-01-08
{{tp_title_tomorrow}}- title_f: Date format of the title, refer to format reference (default: YYYY-MM-DD). You want this argument to be the same as the daily note core plugin format setting.
- f: Format for the date, refer to format reference (default: YYYY-MM-DD HH:mm).
Retrieves tomorrow’s date from the file’s title date referential.2021-01-10
{{tp_daily_quote}}NoneRetrieves and parses the daily quote from the API https://quotes.rest/.templater_daily_quote
{{tp_random_picture}}- size: Image size in the format <width>x<height>(default: 1600x900).
- query: Limit selection to photos matching a search term. Multiple search terms can be passed separated by a comma , (don’t forget to add quotes around the whole argument value) (default: None).
Gets a random image from https://unsplash.com/.![image](https://images.unsplash.com/photo-1602583019685-26371425dc0f)
{{tp_title_picture}}- size: Image size in the format <width>x<height> (default: 1600x900).Gets an image from https://unsplash.com/ based on the note title.![title_image](https://images.unsplash.com/photo-1602583019685-26371425dc0f)
{{tp_cursor}}NoneThis will set the cursor to this location after the template has been inserted.None

See also: date format reference

Side note: when testing {{tp_title_picture}}, git-repo.md gave me:

title_image

Related