-
I 'm migrating my org notes to markdown (and obsidian.nvim). Is there a way to toggle creating the frontmatter for the new files? I copied the converted files into my fault, but obsidian.nvim does not add a frontmatter. It only adds frontmatter for new files that I created with obsidian.nvim. Also: any suggestions how to script this? I have a few thousand notes and don't want to do it manually. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey @sotte should be scriptable. Create a Lua file ( local scan = require("plenary.scandir")
local Note = require("obsidian.note")
local client = require("obsidian").get_client()
local paths = scan.scan_dir(tostring(client.dir), { search_pattern = ".*.md$" })
for _, path in ipairs(paths) do
print(string.format("Updating note at %s...", path))
local note = Note.from_file(path, client.dir)
note:save()
end Then from a buffer in your vault (obsidian.nvim needs to be loaded), run |
Beta Was this translation helpful? Give feedback.
Hey @sotte should be scriptable. Create a Lua file (
tmp.lua
) with something like this:Then from a buffer in your vault (obsidian.nvim needs to be loaded), run
:luafile tmp.lua
.