feat(blog): generate OG images on postBuild hook#1047
Open
feat(blog): generate OG images on postBuild hook#1047
postBuild hook#1047Conversation
Deploying electron-website with
|
| Latest commit: |
d23b7f1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a4aeb1c8.electron-website.pages.dev |
| Branch Preview URL: | https://feat-og-image-plugin.electron-website.pages.dev |
2cb0c48 to
4950004
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
4950004 to
bbae12d
Compare
dsanders11
approved these changes
Mar 18, 2026
dsanders11
requested changes
Mar 18, 2026
package.json
Outdated
Comment on lines
+51
to
+53
| "satori": "^0.25.0", | ||
| "semver": "^7.5.4", | ||
| "sharp": "^0.34.5", |
Member
There was a problem hiding this comment.
Can these be in devDependencies since they are only used in the postBuild hook?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new plugin for OpenGraph image generation for rich social media previews. Under the hood, it uses Vercel's satori library to turn the React layout into an SVG, and then
sharpto rasterize that output into a PNG.Note that this plugin only runs on Docusaurus
postBuild, so you'll need toyarn build && yarn serveto see the magic happen.Testing
The Cloudflare Pages deployment for this PR contains a full build of the website:
https://feat-og-image-plugin.electron-website.pages.dev/
To spot check the image generation, append
/og-image.pngto the end of any blog post URL (e.g. https://feat-og-image-plugin.electron-website.pages.dev/blog/from-native-to-js/og-image.png)