templates#

Templates define the initial content of a newly created note. They live in a dedicated template directory configured at vault initialization (the templateDirectory parameter of vault/init).

template directory#

The template directory is an ordinary folder containing markdown files. Each file is a template, and its filename (without extension) is the template name. For example, daily.md in the template directory is referenced as daily when creating a note.

placeholders#

Templates support the following placeholders, which are expanded at note creation time:

PlaceholderExpansion
{{title}}The title passed to the note/create command.
{{date}}The current date in YYYY-MM-DD format.
{{slug}}The slug derived from the title.
{{file}}The full filename, equivalent to slug.md.

example template#

A template file at .templates/log.md:

---
title: {{title}}
date: {{date}}
tags: ["log"]
---

# {{title}}

When a note is created with title: "April standup" and templateName: "log", the daemon expands the placeholders, writes the resulting content to disk, and indexes the new note.

default template#

If no templateName is provided in the note/create command, the daemon uses a built in default template that produces a minimal frontmatter block:

---
title: <title>
date: <current date>
---

This ensures every note has valid frontmatter for indexing, even when no custom template is specified.