Obsidian Templates

Чтобы соблюсти консистентность с obsidian.nvim, нужно сделать похожие шаблоны только для приложения Obsidian.

Важно, чтобы Front Matter совпадало

note_frontmatter_func = function(note)
  -- Add the title of the note as an alias.
  if note.title then
    note:add_alias(note.title)
  end
 
  local out = { id = note.id, aliases = note.aliases, tags = note.tags }
 
  -- `note.metadata` contains any manually added fields in the frontmatter.
  -- So here we just make sure those fields are kept in the frontmatter.
  if note.metadata ~= nil and vim.tbl_count(note.metadata) > 0 then
    for k, v in pairs(note.metadata) do
      out[k] = v
    end
  end
  return out
end,

Тогда для Obsidian template будет выглядеть так

---
id: test-333
aliases:
  - test-333
tags: []
---
 
# test-333

и daily

---
id: "{{title}}"
aliases:
  - Thursday May 23, 2024
tags:
  - daily-notes
---
 
# Thursday May 23, 2024

obsidian