Overview

Templater is the community plugin that replaces Obsidian’s static Templates core plugin when a template needs logic: file context, date arithmetic, prompts, or scripts. Use it to inject the frontmatter schema on creation so no note starts without one. Plugin settings are in obsidian-plugins.

Start from a base template with the full schema

Store templates in _templates/. The content-note base:

---
title: "<% tp.file.title %>"
slug: "<% tp.file.title.toLowerCase().replace(/ /g, '-') %>"
category: "<% tp.file.folder(true).split('/')[0] %>"
tags: ["<% tp.file.folder(true).split('/')[0] %>"]
status: "draft"
last_updated: <% tp.date.now("YYYY-MM-DD") %>
summary: ""
related: []
---
 
## Overview
 
## Rules
 
## Related

Templater evaluates the <% %> expressions when the template runs on a new file, so tp.file.title is the note’s real name. The schema fields are defined in vault-frontmatter-schema.

Format dates with tp.date.now

The signature is tp.date.now(format, offset, reference, referenceFormat).

<% tp.date.now("YYYY-MM-DD") %>         // today
<% tp.date.now("YYYY-MM-DD", 7) %>      // seven days from now
<% tp.date.now("dddd", 0, tp.file.title, "YYYY-MM-DD") %>   // weekday of the note's own date

The last form reads the date from the note title instead of the clock, so a daily note created late for 2026-05-14 still shows that day’s weekday.

Script with <%* %> blocks

A <%* %> block runs JavaScript, and tR += appends to the output.

<%*
const category = await tp.system.prompt("Category?", "coding");
tR += `category: "${category}"\n`;
tR += `tags: ["${category}"]\n`;
%>

tp.system.prompt opens a modal. Ask few questions; a template that asks many slows note creation, and its purpose is to cut keystrokes.

Map templates to folders

Under “Folder Templates” in Templater settings, map each content folder to a template: backend/ to _templates/content-note.md, daily/ to _templates/daily-note.md. New notes get the right stub with no manual step, which keeps the schema consistent across the vault.

Compose templates with tp.file.include

<% await tp.file.include("[[_templates/frontmatter]]") %>
<% await tp.file.include("[[_templates/meeting-sections]]") %>

Each included file may itself contain Templater expressions. Keep fragments to one job each so they compose.

Re-run a template on an existing note

Run “Templater: Replace templates in the active file” from the command palette to re-evaluate every <% %> expression in the open note. Use it to refresh last_updated without retyping the date.