# Templates

> Start pages from a reusable file — a meeting note, a journal entry, a project skeleton — with the date and title filled in.

Source: https://docs.docgraph.app/editing/templates/

A template is an ordinary note that lives in your templates folder. There is nothing to register and no special file type: put a page in the folder and it shows up wherever DocGraph offers templates.

## Make a template

1. Create a page in the **Templates** folder at the top of your vault — an `.html` page for HTML notes, or a `.md` file for Markdown notes. (`.htm` and `.markdown` work too.) Create the folder first if your vault doesn't have one.
2. Write it the way you want new pages to start: headings, a task list, a [table](https://docs.docgraph.app/tables-charts/overview/), a callout.
3. Where the date or the page's name should go, type a token such as `{{date}}` or `{{title}}`. Tokens are listed below.

The template's name in the pickers is its file name without the extension. Subfolders inside the templates folder are searched too, a few levels deep, and files whose names start with a dot are ignored. Other file types in the folder — a PDF, an image — are not templates.

An [encrypted](https://docs.docgraph.app/privacy/encryption/) file can't be used as a template: unlock it first.

To keep templates somewhere else, change **Templates folder** under **Settings → General → Vault → Templates & daily notes**. Leave it empty to go back to `Templates`; a single `.` means the vault root, so every page in the vault counts as a template.

## Tokens

| Token | Becomes |
|---|---|
| `{{title}}` | The new page's name (its file name without the extension). When you insert a template into an existing page, the name of that page |
| `{{date}}` | Today's date as `2026-10-01` |
| `{{date:%A, %B %d}}` | Today's date in a shape you choose — here `Thursday, October 01` |
| `{{time}}` | The current time as `14:30`, 24-hour |
| `{{person}}` | Only on [person pages and 1:1 notes](https://docs.docgraph.app/panels/mentions/): the person's name |

Inside `{{date:…}}` you can use `%Y` (year), `%m` (month number), `%d` (day), `%A` (weekday name), `%B` (month name), `%G` and `%V` (the ISO week's year and its week number, `01`–`53`) and `%%` for a literal percent sign. There are no time codes there; use `{{time}}`.

Dates use your local day. Anything else in double braces — `{{project}}`, say — is left exactly as you wrote it, braces and all, so a placeholder you meant to fill in by hand is never silently dropped. There are no conditions or scripts: a template renders the same way next year as it does today.

## Use a template [!both]

### From the slash menu

In a page, type `/` and choose **Template**, then pick one by name — type to filter. The template's content is inserted at the cursor. An HTML page lists your HTML templates and a Markdown note lists your Markdown templates.

For an HTML template only what is inside the `<body>` is inserted; its `<head>`, title and styles are left behind, since you're adding to a page that has its own.

### From the new-file dialog

When your vault has at least one template, the dialog for a new page gains a **From template** row with **Blank** and each template. Choose one, name the page and create it. This time the **whole** file becomes the new page, including its head, title and styles, with `{{title}}` set to the name you typed. If a file with that name already exists, DocGraph refuses rather than overwriting it. Whiteboards don't offer the row.

### From the AI

In [chat](https://docs.docgraph.app/ai/chat/), ask for a page made from a template by name. The agent can list your templates and create a note from one with today's date filled in; it asks you to confirm before writing.

:::tip
A template that carries the [Stamp new lines with the time](https://docs.docgraph.app/editing/block-properties/#recording-when-a-line-was-written) switch turns it on for every page made from it — the intended way to set up a log or a journal.
:::

## Daily notes

Today's note can start from a template too. Set **Daily note template** under **Settings → General → Vault → Templates & daily notes** to a template's vault path, and the first `⌘D` of each day creates the day's page from it. If that template has gone missing, DocGraph creates a plain page titled with the date instead of failing.

### Daily note filenames

**Filename** in the same section sets what each day's note is called. `{{date}}` (the default) names it `2026-10-01`; `{{date:…}}` takes the same codes as in a template (`%Y`, `%m`, `%d`, `%A`, `%B`). A `/` in the pattern makes subfolders: `{{date:%Y/%m}}/{{date}}` files today's note as `Daily/2026/10/2026-10-01`. Only date tokens work here — `{{time}}` or `{{title}}` is refused, so today's note stays the same file all day. The hint under the field shows today's filename.

### Moving between daily notes

`⌥⌘←` and `⌥⌘→` step to the previous and next daily note.

## Weekly and monthly notes

DocGraph also keeps one note per week and one per month. Open them from `⌘K` (**Open this week's note** / **Open this month's note**), from the **Week** and **Month** buttons in the [Calendar](https://docs.docgraph.app/panels/overview/#calendar) panel's header (for the selected day), or with a system-wide shortcut — both are off until you pick a key under **Settings → General → Vault → Templates & daily notes**.

In the same section, **Weekly note** and **Monthly note** set where they go, folder and filename together: `Weekly/{{date:%G-W%V}}` (for example `Weekly/2026-W41`) and `Monthly/{{date:%Y-%m}}` by default. Each has its own template field; without one, a new note is titled "Week 41, 2026" or "October 2026".

In a weekly template, `{{daily:list}}` becomes links to that week's existing daily notes, Monday first.

From a weekly or monthly note, `⌥⌘←` / `⌥⌘→` step to the nearest earlier or later week or month that has a note. They never create one.

## Templates on a shortcut

**Template slot 1**, **2** and **3**, under **Settings → General → Vault → Templates & daily notes**, each pair a template with a destination and an optional system-wide shortcut (no key by default):

| Destination | What the shortcut does |
|---|---|
| **New note** | Creates a note from the template in the folder you set (empty means the vault root), named "*template* *date* *time*" |
| **End of today's note** | Adds the template's text to the end of today's note, creating the note if needed. The template must be the same format as the daily note |
| **End of the open note** | Adds it to the end of the note you have open — or makes a new note, with a message, when none is open |

A slot's shortcut always brings the DocGraph window forward. Slots you've set up also appear in the menu-bar icon's **New from Template** submenu, with their keys.
