19 lines
807 B
Markdown
19 lines
807 B
Markdown
<%*
|
|
// iterbind: binds this note to an iteration note that carries the iterdef component.
|
|
const componentName = "iterbind";
|
|
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["iterbind_target"] = frontmatter["iterbind_target"] ?? "[[]]";
|
|
frontmatter["iterbind_status"] = frontmatter["iterbind_status"] ?? "planned";
|
|
frontmatter["iterbind_role"] = frontmatter["iterbind_role"] ?? "primary";
|
|
frontmatter["iterbind_order"] = frontmatter["iterbind_order"] ?? 0;
|
|
});
|
|
}, 300)
|
|
-%>
|