Collections Reference
Collection query model, grouping, sorting, and template access.
Collections are declarative queries executed over resolve index data.
Execution contexts
- Serve/build runtime: collections are computed per request/page and exposed via
.Collections. - Index time: collections with
materialize: trueare written to artifacts JSON.
Collection kinds
filter
Starts from all pages and applies where/sort/limit/group.
forward
Follows a named link from one page to its targets.
Useful keys:
linkfrom_slug
from_slug can use {{ page.slug }} placeholder (runtime mode).
backrefs
Finds pages that point to a target via a named link.
Useful keys:
linkto_slug
to_slug can use {{ page.slug }} placeholder (runtime mode).
Filtering clauses
Current built-in filters in where.all:
type_in: ["article", "page"]fm_eq: { key: "draft", value: false }
Sorting and grouping
Sort by:
title,slug,updated_at,created_atfm.<field>
Group by:
typefm.<field>
With group_by.multi: true, array-valued FM fields can place one item into multiple groups.
Materialization constraints
When enabled in validation, materialized collections must define:
limitgroup_by.item_limit(when grouping is used)
Also, materialized from_slug/to_slug cannot use {{ page.slug }} placeholders.