Documentation site generator
Add automatic per-page MyOG.social images with the Docusaurus 3.10+ plugin or a manual src/theme/Root.tsx recipe.
Install docusaurus-plugin-myog for Docusaurus core 3.10 or later 3.x. The plugin wraps the resolved SiteMetadata component, replaces global image defaults, and keeps existing Root components. Front matter and MDX page images still win.
The manual option below uses src/theme/Root.tsx to read the site URL and current path, then add a MyOG og:image and twitter:image. Use one option. When switching to the plugin, remove the manual MyOG Head block and keep any other Root logic.
Docusaurus pre-renders each route to static HTML, so the tags are in the HTML that social crawlers fetch. Docs, blog posts, tag pages, versioned docs, and the home page all get their own image without a URL per page.
The plugin writes metadata without fetching images during builds or navigation. Social platforms request the image URL when they preview a page; generation and refreshes use your MyOG credits.
MyOG detects page content and branding automatically. The layout only controls image composition.
Run pnpm add docusaurus-plugin-myog@^0.2.0 in your Docusaurus site, then add this plugin entry to your existing docusaurus.config.ts or .js. Keep your other plugins in the same array.
Preview anonymously. Sign in to get complete install code for your account.
Sign in to get install codeKeep global theme image settings and existing Root components. Page images override MyOG. Remove static og:image/twitter:image entries from headTags and any manual MyOG Head block before enabling the plugin.
Use this option without the plugin. Create this file, or add the Head block to an existing Root while keeping its other logic.
Preview anonymously. Sign in to get complete install code for your account.
Sign in to get install codeDocusaurus already emits twitter:card summary_large_image. If your site isn't TypeScript, save it as src/theme/Root.js, drop the type import, and change the signature to Root({ children }).
The plugin replaces themeConfig.image and themeConfig.metadata image defaults; the manual Root recipe renders before them and needs those defaults removed. Front matter image replaces both MyOG tags. An MDX <head> block replaces only the tags it sets. Static headTags sit outside Helmet and must not duplicate the image tags; the plugin warns about them.
The wrapper reads siteConfig.url and the route path, which already includes baseUrl and your trailingSlash form. Versioned docs, blog pagination, and tag pages get their final URL the same way, so you don't keep a list of pages.
Start with the MyOG Open Graph Checker, then refresh social platform caches if needed.
Add your public domain, then use a paid plan or card trial for generated social previews on your Docusaurus pages.
Already have an account?
d6da63065f957eac3c92e241d07decc62fced9b5