Normalized configuration for one page's social metadata and image response.
Applications do not normally construct this struct. OgEx creates it
internally from either og: CardModule or an og: [...] direct-image
declaration. The same value is consumed by head-tag injection, signature
verification, private-file responses, and generated-card rendering.
Fields
:strategyselects the response lifecycle.{:generated, CardModule}renders HEEx with Takumi;:existingemits an existing image directly.:assignscontains ordinary controller assigns available to a generated card. Direct images retain it for a consistent controller boundary.:metadatacontains normalized Open Graph and Twitter values such as:title,:description,:image_alt, and:twitter_card.:versionis a URL-safe content identity used in signatures, ETags, and final-image cache keys. It never contains the original assigns.:image_urlis the absolute Open Graph image URL placed in the document.:twitter_image_urlis an optional separate Twitter image URL. Metadata falls back to:image_urlwhen this is nil.:cardis the generated card module. It is nil for direct images.:widthand:heightare generated canvas dimensions or verified direct local-image dimensions. They may be nil for a remote direct image when the declaration did not provide explicit dimensions.:formatis the generated output format or the verified local image format. It may be nil for remote direct images because OgEx deliberately does not fetch those URLs during an HTML request.:imageis the verified local resource or normalized remote source used for Open Graph metadata in the direct-image strategy.:twitter_imageis the corresponding Twitter resource or source. It is the same logical image as:imageunless:twitter_imagewas declared.
Generated-card configs use :card, dimensions, and format, while their
:image fields remain nil. Direct-image configs use :image fields while
:card remains nil. Code consuming this struct should branch on :strategy
rather than infer the strategy from optional fields.
Summary
Types
@type direct_image() :: OgEx.Image.Resource.t() | OgEx.Image.Source.t()
@type strategy() :: {:generated, module()} | :existing
@type t() :: %OgEx.Config{ assigns: map(), card: module() | nil, format: :png | :jpeg | :webp | :gif | :svg | nil, height: pos_integer() | nil, image: direct_image() | nil, image_url: String.t(), metadata: map(), strategy: strategy(), twitter_image: direct_image() | nil, twitter_image_url: String.t() | nil, version: String.t(), width: pos_integer() | nil }