Skip to content

Demo vault

Every screenshot and code block on this page comes from the bundled demo vault.

Download the English demo vault

Frontmatter routing ​

Write album = trip → wide in the settings and any note with that frontmatter uses the wide template. Matching is exact string comparison, top to bottom.

Anatomy of a route ​

FieldMeaningExample
Field namethe frontmatter keyalbum
Field valuethe value to matchtrip
Route templatewhich template to usewide
Enabledwhether it participateson
yaml
---
album: trip
---

This note writes album: trip, so it matches the route above. Here is the same 1:1 calibration image under the two templates:

A square at 68% of the column under the wide template, centred

Under auto it takes about four tenths of the column; under wide it becomes 68% (about 517px in a 760px column), still centred.

Portraits behave differently — the third rule of wide narrows them and pins them to the left:

A 2:3 portrait narrowed and floated left under the wide template, text wrapping on the right

That is where templates earn their keep: the same assets change rhythm completely with a different template, without touching a single image parameter.

Matching rules ​

BehaviourExplanation
Comparisonboth key and value are trim()ed then compared for exact equality; Trip is not trip
Ordertop to bottom, first match stops the search
Fallbackauto when nothing matches
Priorityan image's own ag:width / ag:layout / ag:side beats template rules

Array values become strings ​

Arrays in frontmatter are joined with commas before comparison:

yaml
tags: [a, b]      # what actually gets compared is "a,b"

So tags makes a poor routing key unless you always write the full string. A single-string field such as album, role or series is far more reliable.

When to route ​

SituationAdvice
tutorials want small images, portfolios large onesroute by frontmatter, layer by folder or attribute
only one or two images need a special widthwrite ag:width, do not build a template for two pictures
an entire note should be narrowerroute it, rather than repeating parameters on dozens of images
you want to separate by folderrouting only reads frontmatter, not paths; add a field to each note

Troubleshooting ​

SymptomCause
The route never matchesdifferent casing, or surrounding spaces in the value (the plugin trims, but key names are not fuzzy-matched)
It matches but nothing changesthe template has no rules, or every image carries ag:width
I changed the template but the note looks the sametemplates are resolved per note; switch notes or reopen the note to recompute

Next ​