Skip to main content
GitHub
1 min read

Plugins

OG Image Plugin

Auto-generate Open Graph images for social sharing

The OG Image plugin generates Open Graph images for each documentation page at build time. These images appear when your docs are shared on social media platforms like Twitter, Facebook, and Slack.

Installation

pnpm add @barodoc/plugin-og-image@latest

Configuration

{
  "plugins": [
    ["@barodoc/plugin-og-image", {
      "background": "#ffffff",
      "textColor": "#0f172a",
      "accentColor": "#0070f3"
    }]
  ]
}

Generated images are placed in dist/og/ and automatically linked via <meta property="og:image"> tags.

Each image includes:

  • Site name (in accent color)
  • Page title
  • Page description

Options

fontPathstring

Path to a TTF/OTF font file for text rendering. Falls back to a system default

backgroundstring

Background color. Default: "#ffffff"

textColorstring

Text color for title and description. Default: "#0f172a"

accentColorstring

Accent color for the site name. Default: "#0070f3"

widthnumber

Image width in pixels. Default: 1200

heightnumber

Image height in pixels. Default: 630