Create a note without id or -
🚀 The feature, motivation and pitch
i like to create a note and obsidian didnt transform the title. Like [[my new note]] will become "my new note.md" I tried to tweak the functions in config but dont have the intelligence to make work without errors
Alternatives
No response
Additional context
No response
You can customize the created note path in:
-- Optional, customize how note file names are generated given the ID, target directory, and title.
---@param spec { id: string, dir: obsidian.Path, title: string|? }
---@return string|obsidian.Path The full path to the new note.
note_path_func = function(spec)
-- This is equivalent to the default behavior.
local path = spec.dir / tostring(spec.id)
return path:with_suffix(".md")
end,
To achieve what you want, add this in the configs:
-- Optional, customize how note file names are generated given the ID, target directory, and title.
---@param spec { id: string, dir: obsidian.Path, title: string|? }
---@return string|obsidian.Path The full path to the new note.
note_path_func = function(spec)
local path = spec.dir / tostring(spec.title)
return path:with_suffix(".md")
end,
Note: This will changes just the filename not the id, the id by default will be timestamp-####, to change it check: Random ID as note name instead of the actual note name · Issue #756 · epwalsh/obsidian.nvim · GitHub.
thanks, it did work. But now how do i prevent to it not create a alias with the same name of my title ?
since my file name already have the name that i want, dont need to the alias have the same name