Automate OG link previews with altimeter#16
Draft
binhonglee wants to merge 1 commit into
Draft
Conversation
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>
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.
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 asog:image/twitter:imagecards.What changed
scripts/generate-og-previews.js— serves the static site locally, runs altimeter at 1200×630, writes JPEGs tostatic/og/, and updates meta tagsscripts/og-pages.json— manifest of pages to capture (add new pages here)package.json—npm run generate:og-previewsfor local runs.github/workflows/generate-og-previews.yml— regenerates previews on pushes toassetswhen HTML/CSS/JS changes (also supports manual dispatch)docs/stack.htmlanddocs/stack_reviewer.htmlUsage
To add a new page later, add an entry to
scripts/og-pages.jsonand re-run the script.Notes
static/og/with stable names likedocs-fetch.jpgstatic/base.jpgis left in place but no longer referenced by meta tags