Obsidian frontmatter generator
Generate your frontmatter on save.
Powerful, dead simple
Usage
-
after install the plugin, visit the setting of the plugin
-
change the frontmatter template
for example, the following frontmatter template
folder: file.folder
title: file.title
test: ["1", "2"]
will generate this in the file Good recipes/scrambled egg.md
on save.
folder: Good recipes
title: scrambled egg
test:
- "1"
- "2"
Syntax of the frontmatter template
It is just a json. It can access the TFile and do javascript operation
^ even functions work
^ async function doesn’t work
Installation
Install on obsidian plugin marketplace
Still waiting for review and approval:
Manual Install
-
cd to
.obsidian/plugins
-
git clone this repo
-
cd obsidian-frontmatter-generator && bun install && bun run build
-
there you go
Note
-
to stop generate on a file, you can put
yaml-gen-ignore: true
on the frontmatter. You can also ignore the whole folder in the seting. -
the context that you can access is TFile. This can be update in the future. It is extremely flexible.
-
This plugin also comes with some command to run in folder and in the whole vault.
-
If you want to contribute, first open an issue.
-
This plugin is still under development, don’t try to hack it by using weird keywords or accessing global variables in the template. It should not work but if you figure out a way to hack it, it will just break your own vault.