Templates
Templates let you define reusable note structures with dynamic content. Insert dates, prompt for input, run conditional logic, and loop over data — all from a Markdown file with YAML frontmatter.
Create a template
Section titled “Create a template”- Press
Cmd+K(macOS) orCtrl+K(Windows/Linux) to open the command palette. - Select Create Template from Selection.
- Fill in name, category, tags, and content.
- Click Save Template.
Templates are stored as .md files in <workspace>/templates/.
Template file structure
Section titled “Template file structure”Each template is a Markdown file with YAML frontmatter:
---id: daily-standupname: "Daily Standup Notes"category: Worktags: - meeting - dailycreatedAt: 2025-11-06T00:00:00.000ZupdatedAt: 2025-11-06T00:00:00.000Z---
# Daily Standup - {{date.format('MMMM do, yyyy')}}
## What I did yesterday{{cursor}}
## What I'll do today
## BlockersThe id must be lowercase alphanumeric with hyphens or underscores.
Use a template
Section titled “Use a template”Press Cmd+K, type the template name or browse the list, and select it. Content is inserted at your cursor with all variables resolved.
Variables
Section titled “Variables”Basic variables
Section titled “Basic variables”| Variable | Output |
|---|---|
{{date}} | Current date (YYYY-MM-DD) |
{{time}} | Current time (HH:mm:ss) |
{{datetime}} | Current date and time |
{{timestamp}} | Unix timestamp |
{{user}} | Current username |
{{uuid}} | Unique identifier |
{{cursor}} | Places cursor here after insert |
Date operations
Section titled “Date operations”Format dates, do arithmetic, and access properties — all chainable:
{{date.format('MMMM do, yyyy')}} → February 22nd, 2026{{date.add(7, 'days')}} → 7 days from now{{date.subtract(2, 'weeks')}} → 2 weeks ago{{date.tomorrow}} → Tomorrow's date{{date.nextMonday}} → Next Monday{{date.startOfWeek}} → Start of current week{{date.week}} → Week number (1-53){{date.quarter}} → Quarter (1-4){{date.add(7, 'days').format('MMM do')}} → Chained operationsFormat tokens: yyyy (year), MM (month), dd (day), MMMM (full month), dddd (full day name).
Arithmetic units: 'days', 'weeks', 'months', 'years'.
Relative dates: tomorrow, yesterday, nextWeek, lastWeek, nextMonday, previousFriday.
Boundaries: startOfWeek, endOfWeek, startOfMonth, endOfMonth, startOfYear, endOfYear.
Conditionals
Section titled “Conditionals”{{#if priority == 'High'}}This is a high priority task!{{else if priority == 'Medium'}}This is a medium priority task.{{else}}This is a low priority task.{{/if}}Operators: ==, !=, >, >=, <, <=, &&, ||. Conditionals can be nested.
{{#each tasks}} {{@index}}. {{this.title}} ({{this.status}}){{/each}}Loop variables: {{@index}} (0-based), {{@first}}, {{@last}}, {{@length}}, {{@key}}.
Filters
Section titled “Filters”Transform values with the pipe (|) operator:
{{name | upper}} → UPPERCASE{{name | lower}} → lowercase{{name | truncate(50)}} → Truncate to 50 chars{{items | join(', ')}} → Join array with comma{{items | sort}} → Sort alphabetically{{date | dateFormat('yyyy-MM-dd')}}{{date | timeAgo}} → "3 days ago"{{name | trim | upper | truncate(20)}} → Chain filtersOther string filters: capitalize, title, slug, replace('old', 'new').
Other array filters: first, last, length, unique.
User prompts
Section titled “User prompts”Ask for input when the template is applied:
{{prompt:title:Meeting title:Team Sync}}Format: {{prompt:variableName:label:defaultValue}}.
For dropdown choices:
{{suggest:status:Status:Planning,In Progress,Review,Done:Planning}}Template includes
Section titled “Template includes”Reuse templates inside other templates:
{{include:header}}{{include:greeting:name=John,time=morning}}JavaScript execution
Section titled “JavaScript execution”{{js: return new Date().getFullYear()}}{{js: return Math.random() > 0.5 ? 'Yes' : 'No'}}Available: Math, Date, JSON, standard object methods, plus helpers uuid(), format(), slugify().
Example: meeting notes
Section titled “Example: meeting notes”---id: meeting-notesname: "Meeting Notes"category: Worktags: - meeting---
# {{prompt:meetingType:Meeting type:Team Sync}} - {{date.format('MMM do')}}
**Date:** {{date.format('MMMM do, yyyy')}}**Attendees:** {{prompt:attendees:Who attended?:}}
## Agenda1.2.
## Discussion{{cursor}}
## Action Items- [ ] Task | Due: {{date.add(7, 'days').format('MMM do')}}Manage templates
Section titled “Manage templates”- List: Browse all templates, filter by category
- Update: Modify name, content, category, or tags
- Delete: Remove a template file
Edit template files directly in any text editor. Changes sync with Lokus when you refresh the Template Manager.