You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and when I run :ObsidianNew test I get a file with
---id: helloaliases:
- testtags: []---# test
as expected.
But when I run :ObsidianNewFromTemplate test and use any template (with or without the yaml metadata explicitly being in the template using {{id}}), I get
---id: testaliases: []tags: []---# test
It seems that somehow the title is being used in place of the id in templates.
Config
require("obsidian").setup({
workspaces= {
{ name="personal", path="~/obsidian/personal" },
},
preferred_link_style="markdown",
daily_notes= {
date_format="%Y-CW%V",
alias_format="%Y-CW%V",
default_tags= { "weekly-notes" },
},
mappings= {
-- Smart action depending on context, either follow link or toggle checkbox.
["<cr>"] = {
action=function()
returnrequire("obsidian").util.smart_action()
end,
opts= { buffer=true, expr=true },
},
},
templates= {
folder="templates",
date_format="%Y-%m-%d",
time_format="%H:%M",
},
-- Optional, customize how note file names are generated given the ID, target directory, and title.---@paramspec{ id: string, dir: obsidian.Path, title: string|? }---@returnstring|obsidian.Path The full path to the new note.note_path_func=function(spec)
-- This is equivalent to the default behavior.localpath=spec.dir/tostring(spec.title:gsub("", "-"):gsub("[^A-Za-z0-9-]", ""):lower())
returnpath:with_suffix(".md")
end,
-- Optional, customize how note IDs are generated given an optional title.---@paramtitlestring|?---@returnstringnote_id_func=function(title)
return"hello"end,
})
🐛 Describe the bug
For demonstrations sake, in my config I have
and when I run
:ObsidianNew test
I get a file withas expected.
But when I run
:ObsidianNewFromTemplate test
and use any template (with or without the yaml metadata explicitly being in the template using {{id}}), I getIt seems that somehow the
title
is being used in place of theid
in templates.Config
Environment
The text was updated successfully, but these errors were encountered: