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
fontPathstringPath to a TTF/OTF font file for text rendering. Falls back to a system default
backgroundstringBackground color. Default: "#ffffff"
textColorstringText color for title and description. Default: "#0f172a"
accentColorstringAccent color for the site name. Default: "#0070f3"
widthnumberImage width in pixels. Default: 1200
heightnumberImage height in pixels. Default: 630