How to change a line of tags to a list of tags in yaml? #1347
-
I have already had a bunch of notes with tags in yaml in a line, such as
what I would like to do, whether can change these tags in to a list, like this:
may a template do this? I had try the linter plugin, with several possible settings I guessed, none of them works. So, I think maybe template can handle it. thanks for helps. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Something like this should work <%*
const file = tp.file.find_tfile(tp.file.path(true));
await app.fileManager.processFrontMatter(file, (frontmatter) => {
frontmatter.tags = frontmatter.tags.split(" ");
});
-%> If you're interested in running this on all your notes at once, you may be interested in this script |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Something like this should work
If you're interested in running this on all your notes at once, you may be interested in this script
https://zachyoung.dev/posts/templater-snippets#run-obsidian-frontmatter-formatter-on-every-file