Auto-Apply Templater Templates by Folder in Obsidian
I use Obsidian to manage my blog content. My vault has two symlinked folders pointing to my website’s content directories: one for quick feed posts and another for longer-form writing.
Each content type needs different frontmatter. Feed posts are lightweight—just a date and some tags. Blog posts need a title, topics, timestamps, and other metadata.
Manually copying frontmatter every time I create a new post gets old fast. Templater’s folder templates fix this.
The Setup
Templater lets you assign a template to a folder. When you create a new file in that folder, the template runs automatically.
Here’s my folder structure:
vault/
├── feed/ → symlink to src/content/feed
├── blog/ → symlink to src/content/blog
└── templates/
├── feed.md
└── writing.md
Creating the Templates
My feed template is minimal:
<%* /* templates/feed.md */ -%>
---
draft: false
date: <% tp.date.now("YYYY-MM-DDTHH:mm") %>
tags: [<% await tp.system.prompt("Tags (comma-separated)") %>]
---
<% tp.file.cursor() %>
The writing template captures more metadata:
<%* /* templates/writing.md */ -%>
---
title: <% await tp.system.prompt("Title") %>
draft: false
ignore: false
topics:
- <% await tp.system.prompt("Topics (comma-separated)").then(t => t.split(",").map(s => s.trim()).join("\n - ")) %>
created_at: <% tp.date.now("YYYY-MM-DDTHH:mm") %>
date: <% tp.date.now("YYYY-MM-DDTHH:mm") %>
last_modified: <% tp.date.now("YYYY-MM-DDTHH:mm") %>
---
<% tp.file.cursor() %>
When triggered, Templater prompts me for the title and topics, formats everything, and places my cursor right where I need to start writing.
Configuring Folder Templates
- Open Settings → Templater
- Scroll to “Folder Templates”
- Add a new folder template mapping:
- Folder:
feed - Template:
templates/feed.md
- Folder:
- Add another for blog posts:
- Folder:
blog - Template:
templates/writing.md
- Folder:
How It Works
Now when I create a new file in the feed folder, Templater intercepts the creation and runs feed.md. The template executes, fills in the date, prompts me for tags, and I’m ready to write.
Same thing for blog posts—new file in blog, the writing template fires, I fill in the prompts, and the frontmatter is structured exactly how my site expects it.
No copying. No forgetting fields. No mismatched formats.
One Gotcha
Templater only triggers on new file creation, not on moving files into a folder. If you create a file elsewhere and drag it in, the template won’t run.
The workaround: always create files directly in the target folder, or use Templater’s command palette to insert a template manually.
Why This Matters
Small friction adds up. Every time you have to remember the right frontmatter format, copy from another file, or fix a typo in a field name—that’s mental energy not spent on the actual writing.
Folder templates eliminate that friction entirely. Create file, answer prompts, write. The system handles the rest.