Skip to main content

Module attachment

Module attachment 

Source
Expand description

An attachment’s page: what a sidecar renders as.

A sidecar is a document — it has a title, a place in the tree, an audience of its own — whose body is not prose but a payload: a photograph, a PDF, a recording. It is a node like any other, so it publishes as a page like any other, in the site frame, listed by its parent, walked by the pager, and that page’s body is the one thing the payload can be shown as. Nothing here reads a file: the collector shipped the payload beside the page (plates::collect), and the page reaches it by the sibling reference the sidecar itself declares.

The embed is chosen by the payload’s extension, which is all a renderer that reads no bytes can go on: an image is a figure, a video or a recording is a player, a PDF is a frame with a download link beneath it for the readers whose browser will not scroll one, and anything else is the link alone. Every reference is a src or an href, on purpose — those are the attributes an encrypted site’s reader shell knows to decrypt, and an <object data> would ship ciphertext into the viewer.

Functions§

payload_of
The payload a sidecar’s metadata names — its content, when the document is an attachment (an explicit attachment: true, or a content prov reads as an opaque payload rather than prose) — or None for a page.
render
The page body for an attachment titled title whose payload sits beside the page at payload (a sibling reference, as the sidecar declares it). Returns the HTML and the Markdown a template reads as the page’s source body — an image or a link, which is what an author would have written.