Gather up tags and format for YAML frontmatter #140
luckman212
started this conversation in
Templates Showcase
Replies: 1 comment
-
Hi, btw thanks for sharing your Idea, I improved it a little bit, with this I don't need to be at the positions at tags and populate correctly, although it still doesn't update just insert.
Regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Gathers all tags from the current file, sorts & de-duplicates them into a YAML-ready string for the frontmatter. This also lets you use the
#tagXXX...
format so you get the autocomplete, yet still end up with a clean taglist for YAML.Setup
Save these 2 templates in your templates folder. Assign a hotkey for Template2 (I use ⌃ctrl ⇧shift T). You can also assign a hotkey to Template1 if you want.
Template1 (name it e.g. "YAML frontmatter tags")
Template2 (name this e.g. "tags from current file as YAML")
Usage
Put your cursor near the top of your note, and then trigger Template1. Type your tags, then double-click where it says
double_click_me
Then, trigger your hotkey for Template2.
Result:
Lastly, put that YAML block at the top of your note and delete the temporary block.
Final Result:
Beta Was this translation helpful? Give feedback.
All reactions