18 lines
748 B
Markdown
18 lines
748 B
Markdown
<%*
|
|
// 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)
|
|
-%>
|