sitereal
v0.1

Content & media

Media

The library, alt text, uploads and how an asset is referenced.

The media library is your public/ folder with a picker in front of it. There is no CDN, no upload service and no second copy of anything: an asset is a file in the repo, referenced by its site path.

<img builder-data-element="image" src="/images/harbour.jpg" alt="The harbour at dusk" />

What the library shows

Everything under public/ that is an image or a video, with:

  • Alt text, stored per asset in the project document and offered whenever you place the asset.
  • Collections — groups of your own for finding things, not folders on disk.

Metadata is keyed by the path relative to public/, so moving a file loses its metadata rather than pointing at the wrong asset.

Adding assets

Drop files into public/ in Finder or in your editor and they appear. Or upload through the app, which writes into public/uploads/ — and can compress on the way in, so a 6MB phone photo does not become a 6MB download.

Alt text

Every image gets an alt. An empty one is a real answer — it means decorative, and screen readers skip it — but it should be a decision, not an omission. The picker asks once and remembers.

In components and content

  • A component can take a media prop, so an instance picks its own image.
  • A content type can have an image field, and the entry form opens the same picker.

Both end up as the same thing in the output: a path under public/.

Astro's own asset pipeline

Files under src/assets/ are processed by Astro (hashed, resized, converted) when imported by a component. public/ is served verbatim — what you put there is what ships, at that path. sitereal places assets from public/ because a visual builder needs a stable, predictable URL; if you want Astro's transforms, import from src/assets/ in a hand-written component and use it from the tree.