Media

The media library reads supported files from public/rigel-media by default. Change the folder with rigel({ mediaDir: "images" }) to use public/images, or the equivalent under a custom Astro publicDir. Existing files in that folder can appear without being uploaded through Rigel.

Upload limits and storage

RC1 defaults to 2 * 1024 * 1024 bytes per upload or downloaded image import. Configure a different positive byte limit in astro.config.mjs:

rigel({
  mediaDir: "images",
  maxFileSize: 50 * 1024 * 1024,
})

A host or proxy may impose a lower limit. Linked remote videos and files already on disk are not uploads subject to this setting.

Local uploads use UUID filenames. The original name remains a display label in .rigel-media.json inside the media folder. Existing asset URLs remain unchanged. Uploading the same file again can create a separate asset; do not rely on deduplication.

The library supports raster images, audio, video, documents, spreadsheets and archives. Image formats include JPEG, PNG, WebP, GIF and AVIF. SVG, HTML and executable files are excluded. Type and signature checks do not replace malware scanning; only upload files you trust, and keep private files outside publicDir.

Browse and edit metadata

Search the library and combine category and modified-month filters. Modified dates come from filesystem metadata, not a permanent upload timestamp. Grid and list views show the same assets.

Select an asset to inspect its details. RC1 supports image and video previews, with native PDF and text previews where available. Editable metadata includes the display name and descriptive fields; image alt text can supply a default when inserting an image. Override it per use when the context differs, or leave it empty for a decorative image.

Saving display metadata does not rename the asset URL or rewrite existing content. File deletion requires confirmation. Removing an asset can break existing references, so check where the site uses it first.

Insert an image

Open an image field or the article editor’s image command. Choose a library asset or an available source, inspect its preview and confirm. The content change remains an unsaved draft until Save.

Local upload and supported downloaded imports write asset bytes separately from the document Save. Canceling later content edits does not undo an already confirmed file upload. URL downloads need the remote server’s CORS permission and a JPEG, PNG or WebP response. GIF and AVIF are supported as file uploads, not by the downloaded-image import path. Pexels and Pixabay imports use downloaded images; Unsplash uses its required hotlink and download tracking. Provider access depends on the configured source and credentials in browser settings. Follow each provider’s license and attribution rules.

Local and deployed behavior

Filesystem uploads, imports, metadata changes and file deletion require the local development backend. GitHub media writes are not implemented in RC1. A deployed GitHub editor uses the build-time media snapshot at /rigel/media.json; rebuild and redeploy to refresh that library.

For GitHub editing, add assets through the site’s normal repository workflow first. Do not assume Save uploads a selected local file to GitHub.

Production hosting is responsible for safe media response headers. Set correct content types and X-Content-Type-Options: nosniff, and serve downloadable document or archive types with appropriate attachment headers. The static build cannot configure those HTTP headers for every host.

Documentation

On this page