Expressions in use
Realistic cases, each with its source in backticks next to the live result.
Counting pages
How many pages match:
- projects in total: 2
- pages under
Projects: 2
${count({tag: "project"})} counts every page tagged project, before any limit. The count builtin is the same number a pages block shows with show: count. Counting by status (active, planned, shipped) is not possible yet: the query has no frontmatter filter.
A frontmatter sum
The total budget of all project pages:
16500.5
${sum(pages({folder: "Projects"}), "budget")} sums the frontmatter key budget. Values that are not numbers, and null, are skipped, so a project without a budget does not break the total.
"Open for N days"
This page carries a date in its frontmatter, so:
Offen seit 20 Tagen. Seit dem 20.09.2026.
${days(this.fm.date, today())} gives the whole days from the page date to today; today() is the server's date. The result is null-safe because a missing field is null, and days accepts an ISO string.
The newest page of a tag as a link
The newest project, listed as a link:
- Project Beta2026-09-15
sort: date desc with limit: 1 picks the newest page, and a one-element page list renders as a single link. With limit: 3 the same expression renders the three newest:
- Project Beta2026-09-15
- Project Alpha2026-09-01
link(path, label) makes a wikilink to a fixed path with a label of your choice: Alpha.
In a table cell and in a heading
The count works anywhere inline, including inside a table:
| Metric | Value |
|---|---|
| Projects | 2 |
| Total budget | 16500.5 |
| Features | 18 |
Today is 10.10.2026
A heading can contain an expression too and it is evaluated in the page. The outline and the heading anchor are built from the source text, so the heading above appears there as "Today is".