Skip to content

types.ts#

View Markdown

Source

5 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

5 symbols 3 interfaces 1 types 1 modules 1 parameters 18 members 1 returns

Reference#

interfaceOgImageOptionsOG image generation options (user-facing).

OG image generation options (user-facing).

Signature

export interface OgImageOptions

View source

Members

Properties
NameTypeDescription
cacheoptional boolean
Enable content-hash based caching.
Skips rendering when content hasn't changed.
Default true
concurrencyoptional number
Number of concurrent page instances for parallel rendering.
Default 1
heightoptional number
Image height in pixels.
Default 630
templateoptional string
Path to a custom template file (.ts, .vue, .svelte, .tsx/.jsx).
- .ts: default-export a function (props) => string
- .vue: Vue SFC, rendered via SSR
- .svelte: Svelte SFC, rendered via SSR
- .tsx/.jsx: React Server Component, rendered via SSR
If not specified, the built-in default template is used.
vuePluginoptional "vitejs" | "vizejs"
Vue plugin to use for compiling .vue templates.
- 'vitejs': Use @vue/compiler-sfc (official, default)
- 'vizejs': Use @vizejs/vite-plugin (Rust-based)
Default 'vitejs'
widthoptional number
Image width in pixels.
Default 1200
typeOgImageTemplateFn = (props: OgImageTemplateProps) => string | Promise<string>Template function that receives page metadata and returns an HTML string.

Template function that receives page metadata and returns an HTML string.

Signature

export type OgImageTemplateFn = (props: OgImageTemplateProps) => string | Promise<string>

View source

Parameters

Returns

string | Promise<string>
interfaceOgImageTemplatePropsProps passed to OG image template functions.

Props passed to OG image template functions.

Signature

export interface OgImageTemplateProps

View source

Members

Indexable
[key: string]: unknown
Custom data from frontmatter (arbitrary key-value pairs)
Properties
NameTypeDescription
authoroptional string
Author name
descriptionoptional string
Page description
siteNameoptional string
Site name
tagsoptional string[]
Tags/categories
title string
Page title
interfaceResolvedOgImageOptionsResolved OG image options with all defaults applied.

Resolved OG image options with all defaults applied.

Signature

export interface ResolvedOgImageOptions

View source

Members

Properties
NameTypeDescription
cache boolean
concurrency number
height number
templateoptional string
vuePlugin "vitejs" | "vizejs"
width number
moduletypesType definitions for Chromium-based OG image generation.

Type definitions for Chromium-based OG image generation.

View source

Last updated: