Skip to content

Automate OG link previews with altimeter#16

Draft
binhonglee wants to merge 1 commit into
assetsfrom
cursor/og-preview-automation-6635
Draft

Automate OG link previews with altimeter#16
binhonglee wants to merge 1 commit into
assetsfrom
cursor/og-preview-automation-6635

Conversation

@binhonglee

Copy link
Copy Markdown
Owner

Summary

Social/link previews were inconsistent: only the homepage used a real page screenshot (base.jpg), while doc pages pointed at random tutorial step images or app UI PNGs.

This adds an automated pipeline using @globetrotte/altimeter (Playwright-based) to screenshot each public page and use those as og:image / twitter:image cards.

What changed

  • scripts/generate-og-previews.js — serves the static site locally, runs altimeter at 1200×630, writes JPEGs to static/og/, and updates meta tags
  • scripts/og-pages.json — manifest of pages to capture (add new pages here)
  • package.jsonnpm run generate:og-previews for local runs
  • .github/workflows/generate-og-previews.yml — regenerates previews on pushes to assets when HTML/CSS/JS changes (also supports manual dispatch)
  • 17 preview images generated and wired into all public pages
  • Added missing OG/Twitter metadata to docs/stack.html and docs/stack_reviewer.html

Usage

npm install
npm run generate:og-previews

To add a new page later, add an entry to scripts/og-pages.json and re-run the script.

Notes

  • Previews are stored under static/og/ with stable names like docs-fetch.jpg
  • The old static/base.jpg is left in place but no longer referenced by meta tags
  • The GitHub Action auto-commits regenerated images when site content changes
Open in Web Open in Cursor 

Introduce a generate-og-previews script powered by @globetrotte/altimeter
that screenshots each public page and writes 1200x630 JPEGs to static/og/.
All og:image and twitter:image meta tags now point at these page previews
instead of tutorial step screenshots or shared base.jpg.

Includes a GitHub Action that regenerates previews when site HTML or styles
change, and adds OG metadata to docs/stack pages that were missing it.

Co-authored-by: BinHong Lee <binhonglee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants