Template Syntax

LifeOS currently has two template syntaxes. Choose the one that matches your version:

  • LifeOS Pro / Aino LifeOS: use the built-in syntax, such as {{snapshot:Project}}, {{date}}, and {{tags}}. This syntax does not require Templater.
  • Community / open-source LifeOS: only supports the legacy Templater syntax, such as <% LifeOS.Project.snapshot() %>. If you use the open-source version, do not replace those templates with the new syntax.

Basic Variables

These variables work in periodic note templates and theme note templates:

VariableDescription
{{date}}The note date, formatted as YYYY-MM-DD
{{date:FORMAT}}Format the note date with Day.js, for example {{date:YYYY-MM-DD dddd}}
{{date+N:FORMAT}} / {{date-N:FORMAT}}Offset the note date by N days
{{time}}Current time, formatted as HH:mm
{{time:FORMAT}}Format the current time with Day.js
{{title}} / {{filename}}New note filename without .md
{{year}} / {{month}} / {{day}}Year, month, and day
{{week}} / {{weekYear}}Week number and week year
{{quarter}}Quarter, such as Q1
{{periodType}}Period type: Daily, Weekly, Monthly, Quarterly, Yearly
{{tags}}Theme tag passed when creating a theme note, without the leading #

Snapshot Variables

LifeOS Pro snapshot variables use this syntax:

{{snapshot:Project}}
{{snapshot:Area}}
{{snapshot:Resource}}
{{snapshot:Archive}}
{{snapshot:Theme}}

They generate a numbered list of theme index files under the matching folder. For example, {{snapshot:Project}} scans the project folder, finds each project's index file, and generates:

1. [[1. Projects/Project A/README|Project A]]
2. [[1. Projects/Project B/README|Project B]]

If you use the *.README.md index mode, LifeOS Pro follows your current setting when resolving index files.

Conditional Blocks

You can render different content for weekdays and weekends:

{{if weekday}}

## Workday Plan

- [ ] Handle today's focus task
      {{else}}

## Weekend Review

- [ ] Do a light review
      {{endif}}

weekday means Monday through Friday. Saturday and Sunday use the {{else}} branch. If there is no {{else}}, weekends render empty content.

Periodic Note Example

## Project List

{{snapshot:Project}}

## Daily Records

%%Your records%%

## Tomorrow

{{date+1:YYYY-MM-DD}}

Theme Note Example

When creating a theme note, {{tags}} is replaced with the current theme tag. When writing it as an inline tag, add # yourself:

---
tags:
  - { { tags } }
---

## Tasks

- [ ] #{{tags}} Deadline 📅 {{date+7:YYYY-MM-DD}}

```LifeOS
TaskListByTag
```

Community / Open-Source Compatibility

Community / open-source LifeOS relies on Templater and only supports the legacy syntax:

<% LifeOS.Project.snapshot() %>
<% LifeOS.Area.snapshot() %>
<% LifeOS.Resource.snapshot() %>
<% LifeOS.Archive.snapshot() %>

Theme tags still use Templater frontmatter variables:

#<% tp.frontmatter.tags %>

If you maintain an open-source vault or an older example vault, keep using this legacy syntax and make sure Templater has Trigger Templater on new file creation enabled.