schema

Image

Schema.org Image

  • Type: defineImage(input?: Image)

Describes an individual image (usually in the context of an embedded media object).

Required properties

  • url string
    The URL of the image file (e.g., /images/cat.jpg).

Defaults

  • @type: ImageObject
  • @id: ${canonicalUrl}#/schema/image/${hash(image.url)}
  • inLanguage: options.defaultLanguage (only when caption is provided) (see: user Config)
  • contentUrl: is set to url

Resolves

See Global Resolves for full context.

  • width and height must be provided for either to be included

Examples

Minimal

defineImage({
  url: '/cat.jpg',
})

Types

export interface ImageSimple extends Thing {
  /**
   * The URL of the image file (e.g., /images/cat.jpg).
   */
  url: string
  /**
   * The fully-qualified, absolute URL of the image file (e.g., https://www.example.com/images/cat.jpg).
   * Note: The contentUrl and url properties are intentionally duplicated.
   */
  contentUrl?: string
  /**
   * A text string describing the image.
   * - Fall back to the image alt attribute if no specific caption field exists or is defined.
   */
  caption?: string
  /**
   * The height of the image in pixels.
   * - Must be used with width.
   */
  height?: number
  /**
   * The width of the image in pixels.
   * - Must be used with height.
   */
  width?: number
  /**
   * The language code for the textual content; e.g., en-GB.
   * - Only needed when providing a caption.
   */
  inLanguage?: string
}