Automate Your Vault With Templater - How to Use Templater in Obsidian
Based on FromSergio's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Templater’s main advantage over the Template plugin is automation: templates can be applied based on variables like date and folder location.
Briefing
Templater for Obsidian turns static templates into automated, context-aware workflows—at the cost of a longer setup. Instead of manually inserting the same template every time, Templater can generate note content dynamically using variables like the day of the week and where a note was created. Once configured, it becomes a fast way to keep daily notes, weekly planning, and folder-specific documents consistent without repeating the same work.
A key distinction from the Template plugin is automation. The Template plugin mostly provides reusable blocks, while Templater can apply templates based on conditions and parameters. That flexibility is why the setup takes longer: users must learn the syntax and configure when templates trigger. Internally, Templater functions are split into internal functions and user functions; the walkthrough focuses on internal functions, including access to date/time logic and file metadata. (User functions and the Moment object are mentioned as topics for a future, more advanced video.)
The tutorial starts with the core syntax pattern: every Templater function is wrapped between “<%” and “%>” (shown as left arrow percentage and percentage right arrow). A practical friction point appears immediately: after inserting the syntax, results don’t show in preview mode. To apply changes, users must run “Replace templates in the active file” from the command palette—or assign a hotkey to trigger it. The walkthrough recommends setting a hotkey (for example, Option+R) so activation becomes a single keystroke.
For date automation, the most used functions are “tpdate” and “tpfile.” With “tpdate,” users can generate dates in different formats and relative offsets. The examples show how to produce today’s date, yesterday/tomorrow, and dates in the past or future using offsets like “-1m” (one month back), “+2” (two months forward), and “-1y” (one year back). A major upgrade comes when date outputs are turned into links: wrapping the function in square brackets can create clickable references to daily notes for the computed date, assuming those notes exist in the vault.
The walkthrough then uses this to build “on this day” links inside daily notes, so each entry can jump back to the same date from last year. It also adds navigation breadcrumbs for adjacent days (day before/day after) and weekly shortcuts that link to the current week’s Monday. For the weekly link, “tpdate weekday” uses a numeric mapping where 0 represents Monday and other numbers represent subsequent weekdays.
Beyond dates, “tpfile” pulls file-level metadata. It can insert the file’s creation time, last modified time, and the folder path the file currently lives in—useful for templates that adapt to where notes are stored. Another internal function, “tpweb,” can fetch a daily quote (and optionally random images) from the web; the example uses daily quotes to add low-effort variety to journal entries.
Finally, the tutorial shows how to scale this approach across a vault: folder templates apply specific templates automatically to new files created inside designated folders, while hotkeys provide quick access to templates without relying on folder structure. A “default template” hotkey (triggered via Command+M after Command+N) demonstrates how spontaneously created notes can still receive consistent YAML fields like tags, aliases, created/last modified timestamps, and a title prompt. The guide closes by pointing to Templater’s active GitHub community for inspiration, with a warning not to copy snippets blindly without understanding how they fit a vault’s structure.
Cornell Notes
Templater for Obsidian upgrades templates from static text into automated generators that react to context—especially dates, file metadata, and folder location. The workflow relies on Templater’s syntax wrapper (“<% … %>”) and a required activation step (“Replace templates in the active file”), which becomes practical once a hotkey is assigned. Date functions like tpdate can output today/yesterday/tomorrow and compute relative dates using offsets (e.g., -1m, +2, -1y), and those results can be turned into links to jump to existing daily notes. File functions like tpfile can insert creation time, last modified time, and the current folder path, enabling templates that adapt to where notes live. Folder templates and hotkeys help apply the right template automatically across a vault without manual repetition.
Why does Templater feel more powerful than the Template plugin, and what tradeoff comes with that power?
What’s the practical workflow hurdle when using Templater syntax, and how do hotkeys fix it?
How can tpdate generate relative dates like “last month” or “two months from now”?
How does turning a computed date into a link create useful navigation inside daily notes?
What does tpfile add that tpdate can’t, and where does it matter most?
How do folder templates and hotkeys work together to scale templating across a vault?
Review Questions
- What activation step is required for Templater functions to produce results, and why does preview mode not work?
- Give two examples of tpdate offsets (one in months and one in years) and describe what each would output relative to today.
- How would you use tpfile to display a note’s current folder, and what would you expect to see when the note is moved into a different folder?
Key Points
- 1
Templater’s main advantage over the Template plugin is automation: templates can be applied based on variables like date and folder location.
- 2
Templater syntax must be executed via “Replace templates in the active file,” so assigning a hotkey is the difference between friction and speed.
- 3
tpdate can generate today’s date and relative dates using offsets such as -1m, +2, and -1y, and it can format dates in cleaner ways.
- 4
Wrapping tpdate output in square brackets turns computed dates into clickable links to existing daily notes.
- 5
tpfile can inject file metadata—creation time, last modified time, and folder path—so templates can adapt to where notes live.
- 6
Folder templates let each folder in a vault automatically receive its own template, reducing manual template selection.
- 7
Hotkeys enable quick template application for notes that don’t belong in a strict folder structure, including a default template for spontaneous notes.