How I use Obsidian Templater
It’s day 21 of Blogvent, where I blog daily in December!
If you don’t use Obsidian, or haven’t heard of it, it’s a glorified markdown app. You write markdown notes and it keeps track of your notes in a folder. But, the power beyond the basics of Obsidian is that it has an open plugin system, and you can connect your notes together via tags or links (which can turn into your own personal “wiki” of sorts). I use Obsidian for nearly everything (I’m writing this blog post in Obsidian now), and have written about it before, but I want to focus on a one of my favorite plugins in this post.
I really love the Obsidian Templater plugin. It lets me move super quickly when I create notes with certain structures, big and small.
I have examples of what I mean!
My own “contact” app
Every “contact” type app I’ve tried has fallen short for me in one way or another. It’s hard to keep up to date, or it’s expensive, or it requires too much to fill out. I kind of use Obsidian for that, in the place of a dedicated app.
When I want to make a new “person” note, I tag a person with [[@Their name]]
, or make a file called @Their name
. I set up a little automation that adds my “Person template” to that kind of note.
The person template looks like this:
---
cuid: human<% tp.file.creation_date("YYYYMMDD-HHmmss") %>
alias: ["👤 <% tp.file.title.substring(1) %>", "<% tp.file.title.substring(1) %>"]
tags: person/friends, person/family, person/coworker
---
# 👤 <% tp.file.title.substring(1) %>
🎂 **Birthday:**
💌 **Email:**
☎️ **Phone:**
💼 **Occupation:**
🌎 **Location:**
🏡 **Address:**
| Socials | URL |
| ------------- | -------- |
| Bluesky | https:// |
| GitHub | |
| LinkedIn | |
| Twitter | |
| Personal Site | |
| ... | |
## Quotes
## Related people
## Notes
I’ll break it down:
- Everything with
<% tp. ... %>
is a Templater script that uses JavaScript to manipulate the passed parameter. - The frontmatter of the template generates an ID for the file based on the creation date (I call it a
cuid
instead of auuid
because instead of it being a Universally Unique Identifier, it’s Cassidy’s Unique Identifier, heh). That ID doesn’t mean anything, but I try to have some kind of ID for every file I make in case I need to query my data somehow later on. - It also generates aliases for the person, so I can tag them in a note with just their name (without the
@
) or with an emoji - It automatically gives the person tags for the relationship I have with them (I show just friend, family, or coworker here, but I have other more specific ones too)
- It creates a heading of the person’s name, without the
@
- The rest I manually fill out!
Here’s an example of a generated person named Fakey Fake:
---
cuid: human20241221-234513
alias: ["👤 Fakey Fake", "Fakey Fake"]
tags: person/friends
---
# 👤 Fakey Fake
🎂 **Birthday:** 12/21/2024
💌 **Email:** fakeyfake@fakeyfake.fake
☎️ **Phone:** 123-456-7890
💼 **Occupation:** Loser
🌎 **Location:** #fakeland
🏡 **Address:** Hidden
| Socials | URL |
| ------------- | ----------- |
| Bluesky | https://... |
| GitHub | https://... |
| LinkedIn | https://... |
| Twitter | https://... |
| Personal Site | https://... |
## Quotes
"I'm tired of being fake"
## Related people
[[@Fakey McFakeFace]]
## Notes
- Not real
- Just a faker
It’s not a perfect system, BUT it helps me find a lot of info quickly when I’m contacting a friend of mine or need an address of a family member or something! Sometimes I think I should just go back to a plain ol’ paper address book, but this has been working for me, for now.
My newsletter
If you are subscribed to my weekly newsletter you might notice that it follows a certain structure in every single issue.
That’s a template! I’ll share just the frontmatter for that one:
---
cuid: newsletter<% tp.file.creation_date("YYYYMMDD-HHmmss") %>
alias: "Newsletter on <% tp.date.now('MMM Do YYYY') %>"
dates:
created: <% tp.file.creation_date("YYYY-MM-DDTHH:mm:ss") %>
tags: newsletter
---
Once again, it’s using that Templater <% tp. ... %>
syntax to generate something that looks like this:
---
cuid: newsletter20241221-232944
alias: "Newsletter on Dec 21st 2024"
dates:
created: 2024-12-21T23:29:44
tags: newsletter
---
Having an alias pattern generated like this makes it super easy for me to search for specific issues, and I have some cool patterns for viewing issues in Obsidian that I’ll talk about in a later post.
This blog post
And finally… this blog post uses a template too. I actually show the generated frontmatter I get for every post in a recent blog post, and some more details about how I blog in a different blog post. Once you get the hang of it, these templates can be used for anything!
Anyway, I hope you found some of this useful, in case you’re looking to level up your Obsidian usage.
See you tomorrow!