Skip to content

OgImageOptions

type OgImageOptions =
    {
        FrontMatterKeys: string list
        AltKeys: string list
        Fallback: Page -> OgImage option
        Default: OgImage option
        ExcludeCollections: string list
    }
AssemblyPartas.Nacara.Plugins.OgImage

Options of the og-image plugin.

Fields

FrontMatterKeys: string list

The front matter keys a page names its image under, first match wins.

The value is a path or url, or a mapping with url, alt, width and height. false opts the page out, fallbacks included.

Defaults to [ "og_image"; "ogImage"; "image" ].

AltKeys: string list

The front matter keys the image's alt text is read from, beside a plain path.

Defaults to [ "og_image_alt"; "ogImageAlt"; "image_alt" ].

Fallback: Page -> OgImage option

The image of a page whose front matter names none.

Asked before Default, so a collection or a section can have its own card: fun page -> if page.Collection = "blog" then Some(OgImage.image "/blog-card.png") else None.

Defaults to fun _ -> None.

Default: OgImage option

The image of every page nothing else gave one.

Defaults to None, which leaves such a page without an image.

ExcludeCollections: string list

Collections whose pages get no image at all.

Defaults to [].