CMS plugin

EmDash OG Image Integration

Add MyOG.social images to published EmDash pages that have no image of their own, with the sandboxed @myog.social/myog plugin from the EmDash registry.

Prerequisites

  • EmDash 1.4.0 with a plugin sandbox runner: on Cloudflare, the Workers Paid plan with the LOADER Worker Loader binding and PluginBridge exported from the Worker entry; on Node.js, @emdash-cms/sandbox-workerd and workerd installed and set as the sandboxRunner. The release accepts later 1.x versions, but only 1.4.0 has been tested
  • Your site URL set in EmDash to its public HTTPS origin, and a site template whose layout renders EmDashHead
  • A MyOG account with your site's exact hostname added and available image credits from a paid plan or the 10-day card trial

How MyOG fits EmDash

The MyOG.social plugin, @myog.social/myog, gives each published content page its own social image without designing one per page. When a page has no image of its own, the plugin adds og:image, twitter:image and twitter:card tags. MyOG builds the image from the page's public URL, content and branding.

An image an author chose always wins. If the page has an image in EmDash's SEO panel, or the template supplies the entry's own image, the plugin adds nothing. On every other published content page, the MyOG image replaces the site-wide default social image from your site settings.

The plugin is free and MIT licensed; the images are not. MyOG serves an image only for a registered hostname on an account with credits, and each new render uses one credit. Without them, MyOG returns an error, and link previews show a broken image instead of your site default.

The plugin only writes meta tags. It needs no API key or secret, declares no network hosts and makes no requests. Its one permission, content:read, lets it ask EmDash for the published URL of the page being rendered, which is how it skips drafts and previews.

1

Choose a layout

MyOG detects page content and branding automatically. The layout only controls image composition.

2

Add the EmDash code

Plugin settings (MyOG.social admin page)

Enter these values on the plugin's settings page. Replace the example hostname with the exact hostname you added in MyOG.

Preview anonymously. Sign in to get complete install code for your account.

Sign in to get install code

The account ID is the a= value from your MyOG install code. MyOG uses it to email you if the hostname isn't registered yet. Whether an image is served depends on your registered hostname and credits.

3

Place it correctly

  1. Check that your site has a sandbox runner. The Cloudflare templates ship with the Worker Loader binding commented out unless you enabled sandboxed plugins when scaffolding, and registry installs fail with SANDBOX_NOT_AVAILABLE until a runner is configured.
  2. In MyOG, add the exact hostname your EmDash site is served from. www.example.com and example.com are different hostnames.
  3. In the EmDash admin, find @myog.social/myog in the plugin registry, install it and approve its content:read permission.
  4. Open MyOG.social in the admin sidebar. Enter the hostname, choose a template and optionally add your MyOG account ID, then save. The banner changes from Not configured to Enabled.
  5. Open a published page that has no image of its own and check its head tags.

Avoid duplicate og:image tags

EmDashHead keeps the first og:image it receives, and the plugin's tag comes before the site default, so the site default is dropped on pages the plugin covers. The plugin never adds a tag when the page has its own image. An og:image written by hand into your layout, outside EmDashHead, is not checked; remove it if the rendered page has two.

Dynamic pages

Each published content entry without its own image gets a MyOG image URL. The plugin builds it from the configured hostname and the entry's published path, never from the request's Host header, and drops any query string or fragment. The whole page URL is encoded once as the url value. New entries are covered as soon as they are published.

Test the result

  • Open a published page without its own image, signed out, and view the page source. Expect one og:image and one twitter:image starting with https://api.myog.social/og?, a url value that decodes to the page's public address, and twitter:card set to summary_large_image.
  • Open a page with an SEO panel image and confirm that image is unchanged.
  • Check a draft preview and a page set to noindex. Neither should have a MyOG tag.

Start with the MyOG Open Graph Checker, then refresh social platform caches if needed.

Known limitations

Drafts, previews, pages set to noindex or none in the SEO panel, custom pages, 404 pages, and pages whose rendered path or canonical URL differs from the published URL get no tags. A robots tag written by hand, an X-Robots-Tag header or another plugin's robots setting is not seen.
If the hostname in EmDash's site URL differs from the hostname in the plugin settings, no tags are added. Templates that don't render EmDashHead, such as blank, don't output plugin metadata.
The released bundle was run on EmDash 1.4.0, in astro dev and in a Node.js production build with @emdash-cms/sandbox-workerd. Installing from the registry, the Cloudflare Worker Loader runner, cache providers, social platform crawlers and other EmDash versions have not been tested. The release accepts EmDash >=1.4.0 <2.0.0.
If you cache rendered routes, purge the route or edge cache after changing the plugin settings so pages pick up the new tags.
Account signup and the free checker do not activate image serving. Every image request, including cached images, needs credits on the account; only new renders use one.

Sources

Ready to get started?

Add your EmDash site's hostname in MyOG, then start the card trial to serve images.

Already have an account?

4a02f775f4f425d12754f6c7911b68e2f3cc7713