Behaviour for a content collection: directory + schema + routing (ADR 0003).
parse_source/2 lets a collection derive metadata from the file path
itself (posts take their date and slug from YYYY-MM-DD-slug.md) before
schema validation runs. route/1 maps validated metadata to the
output-relative destination file.
Summary
Callbacks
Directory relative to the site root, e.g. content/posts.
Derives metadata from the source path, merged under the frontmatter.
Output-relative destination for a validated document, or nil for
data-only collections (portfolio entries have no page of their own —
the timeline, story, and CV views render them).
The raw NimbleOptions-style schema keyword list (introspectable).
Callbacks
@callback dir() :: String.t()
Directory relative to the site root, e.g. content/posts.
Derives metadata from the source path, merged under the frontmatter.
@callback route(Cherry.Content.Document.t()) :: String.t() | nil
Output-relative destination for a validated document, or nil for
data-only collections (portfolio entries have no page of their own —
the timeline, story, and CV views render them).
@callback schema() :: keyword()
The raw NimbleOptions-style schema keyword list (introspectable).