Static site framework
Add automatic MyOG.social images to Astro layouts, markdown pages, and content collections.
Astro sites usually centralize meta tags in a layout or Head.astro component. That makes MyOG a small server-rendered tag addition.
Use Astro.url to build the current page URL, or pass a canonical URL prop from content collections if your routing needs tighter control.
This is a docs/code-template opportunity, not a plugin. Astro developers expect a small component-level change.
MyOG detects page content and branding automatically. The layout only controls image composition.
Add this to the shared component that renders page metadata.
---
const pageURL = Astro.url.href
const myogImageURL = `https://api.myog.social/og?url=${encodeURIComponent(pageURL)}&template=screenshot-right`
---
<meta property="og:image" content={myogImageURL} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={myogImageURL} />Some Astro starters already include an image prop or SEO component that emits og:image. Replace that image value with MyOG or add a condition so only one og:image is emitted.
For content collections, pass the page URL or slug into your Head component. For static markdown pages, Astro.url is often enough as long as the site option is configured for production.
Start with the MyOG Open Graph Checker, then refresh social platform caches if needed.
Sign up for free and add generated social cards to Astro pages.
Already have an account?
cdf733b534ea2f2ed964d150330b323c44837e4f