-
-
Notifications
You must be signed in to change notification settings - Fork 198
feat(plugin): add plugin-og-image for dynamic OG image generation #2795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
Co-authored-by: SoonIter <79413249+SoonIter@users.noreply.github.com>
Co-authored-by: SoonIter <79413249+SoonIter@users.noreply.github.com>
Co-authored-by: SoonIter <79413249+SoonIter@users.noreply.github.com>
Co-authored-by: SoonIter <79413249+SoonIter@users.noreply.github.com>
Rsdoctor Bundle Diff Analysis📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
Summary
Implements
@rspress/plugin-og-imageto automatically generate Open Graph images (1200x630 PNG) for each page during build. Uses Satori for SVG rendering from JSX templates and Sharp for PNG conversion.Related Issue
Closes #[issue_number]
Ref: rolldown/rolldown#7135
Implementation
Core Architecture
extendPageDatahook: Collects page metadata (title, description) during buildconfighook: Injectsog:imagemeta tags into SSR HTML viaconfig.headafterBuildhook: Generates PNG images in/og/{route-path}.pngstructureKey Dependencies
satori@0.11.2: React-like JSX → SVG renderingsharp@0.33.5: SVG → PNG conversionCustomization
ogBackgroundColor,ogTextColor)Usage
Result
https://v2.rspress.rs/guide/start/getting-startedhttps://v2.rspress.rs/og/guide/start/getting-started.png<meta property="og:image" content="..." />Checklist
Original prompt
plugin-og-image#2794💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.