Astral.Image.Registry (Astral v0.1.6)

Copy Markdown View Source

Per-render-process registry of image transforms requested by Astral content.

Rendering discovers image variants before the builder generates them. The registry is process-local so concurrent builds do not share state.

Summary

Functions

Register an image transform and return the canonical transform.

Return the site currently being rendered.

Start an empty image registry for a site build.

Clear the current process registry.

Return all registered transforms.

Types

state()

@type state() :: %{
  site: Astral.Site.t() | nil,
  transforms: %{required(String.t()) => Astral.Image.Transform.t()}
}

Functions

add(transform)

Register an image transform and return the canonical transform.

site()

@spec site() :: Astral.Site.t() | nil

Return the site currently being rendered.

start(site)

@spec start(Astral.Site.t()) :: :ok

Start an empty image registry for a site build.

stop()

@spec stop() :: :ok

Clear the current process registry.

transforms()

@spec transforms() :: [Astral.Image.Transform.t()]

Return all registered transforms.