Media
Upload, find and reuse images and files, keep alt text with images, and see where each one is used.
Media is in the admin sidebar, under your collections. Images and files are ordinary files in mediaDir (public/media unless you changed it), committed to your repository with your content. With GitHub storage, each upload and delete is a commit.
Uploading
Choose Upload files, or drop up to ten files anywhere on the page. These are accepted:
| Kind | Formats | Largest |
|---|---|---|
| Images | PNG, JPEG, WebP, GIF, AVIF | 10 MB |
| PDFs | 20 MB | |
| Fonts | WOFF2, WOFF, OTF, TTF | 5 MB |
| Archives | ZIP | 25 MB |
prime checks each file’s first bytes, not just its name, so a different file renamed to .png or .pdf is refused. SVG and HTML are not accepted, because either one opened on its own can run script from your site’s address, and the admin offers PDFs, fonts and zips as downloads rather than opening them. Audio is not accepted: a podcast episode is too large to keep in a repository, so link to it at your podcast host with a url field. For a large download, upload it to your own storage and paste the https:// link into a fields.file() field.
Each upload gets a lowercase file name made from the original, with a number added if that name is taken. A batch reports a result for every file, so one bad file never hides the rest.
Finding images
Search matches a file’s name and its alt text. The filters show everything, only unused files, or only images missing alt text. The counts on the filters and the “Used in” lines on each tile come from reading your entries for the image’s address, so they cover image fields, Markdown images and MDX components alike.
Alt text
Only images have alt text. Open an image to describe it. The text is saved in .prime/media.json, beside your other prime files, not in the media folder, which your site publishes as it is:
{
"files": {
"reading-room.png": { "alt": "A reading room with tall windows" }
}
}
When you choose an image in the editor, its alt text is suggested. An entry can still describe the image differently, because the right description often depends on where it appears.
Where an image is used, and deleting it
An image’s page lists every entry that uses it. Deleting an image removes the file and its alt text together: both go, or neither does. If entries still use it, the confirmation lists them first, because they will show a broken image until you change them. prime cannot rename an image yet, since a new name changes every address that points at it.
Resizing
prime stores your originals and does not resize them. Responsive sizes belong to your framework’s image handling, or to your host.