Skip to content
Discussion options

You must be logged in to vote

You can wrap it in tp.hooks.on_all_templates_executed, like this

# Goals

# Notes

<%*
tp.hooks.on_all_templates_executed(async () => {
  await app.fileManager.processFrontMatter(this.app.workspace.getActiveFile(), (frontmatter) => {
    frontmatter["category"] = [("[[project]]")]
    frontmatter["note_creation_date"] = [`[[${tp.file.creation_date("YYYY-MM-DD")}]]`]
    frontmatter["modified_date"] = [`[[${tp.file.last_modified_date("YYYY-MM-DD")}]]`]
    frontmatter["related_projects"] = []
    frontmatter["status"] = []
    frontmatter["references"] = []
    frontmatter["tags"] = []
  })
});
await tp.file.move(/Notes/ + tp.file.title)
-%>

Or, even simpler, just put the frontmatter in th…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@CAVMOT
Comment options

@Zachatoo
Comment options

@CAVMOT
Comment options

@Zachatoo
Comment options

Answer selected by CAVMOT
@CAVMOT
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants