import vault
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<%*
|
||||
// contextual: binds this note to the closest known context, e.g. project, customer or topic.
|
||||
const componentName = "contextual";
|
||||
const file = tp.file.find_tfile(tp.file.path(true));
|
||||
|
||||
setTimeout(async () => {
|
||||
await tp.app.fileManager.processFrontMatter(file, (frontmatter) => {
|
||||
const components = Array.isArray(frontmatter["components"]) ? frontmatter["components"] : [];
|
||||
if (!components.includes(componentName)) components.push(componentName);
|
||||
|
||||
frontmatter["components"] = components;
|
||||
frontmatter["context_target"] = frontmatter["context_target"] ?? "[[]]";
|
||||
frontmatter["context_role"] = frontmatter["context_role"] ?? "project";
|
||||
frontmatter["context_relation"] = frontmatter["context_relation"] ?? "belongs_to";
|
||||
});
|
||||
}, 300)
|
||||
-%>
|
||||
Reference in New Issue
Block a user