Skip to main content

Module media

Module media 

Source
Expand description

A theme’s sample pictures: the media entries of theme.json, stored in the site’s media library when the theme is applied, and the "@media:<key>" references in page content that point at them.

"media": [ { "key": "hills", "file": "hills.jpg", "title": "Rolling hills",
             "alt": "Layered hills at dawn" } ],
"pages": [ { …, "data": { "cover": "@media:hills" } } ]

The files come with the call (super::apply_with_media), usually embedded in the site’s binary. Each goes through the same path as an upload in the admin. A reference whose picture was not supplied becomes empty, so the page shows no picture rather than a broken one.

Structs§

MediaSeed
One media entry.

Constants§

REF_PREFIX
How page content points at a theme picture.