Skip to content

feat(seo): social preview images for the GitHub repositories - #17

Merged
fylorn merged 1 commit into
mainfrom
seo2/social-preview
Sep 25, 2026
Merged

fylorn merged 1 commit into
mainfrom
seo2/social-preview

Conversation

@fylorn

@fylorn fylorn commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

GitHub has no API for a repository's social preview: the image is uploaded by hand under Settings → General → Social preview. This builds those images with the site's share-card generator, so that they share its type, colors and layout and can be rebuilt from this repository rather than from a one-off script.

  • src/lib/og.ts: the drawing code takes the card size as a parameter (renderCard); renderOgImage draws the site's 1200×630 cards through it as before. The GitHub cards, 1280×640 and one per site card, are defined at the end of the file.
  • src/pages/og/github/[card].png.ts: builds them to /og/github/<card>.png. No page links to them and they are not in the sitemap.
Image Repository Line under the name Labels
/og/github/lite.png ThinkWatch-Lite Desktop app for a local AI API gateway macOS · Windows · Linux
/og/github/core.png ThinkWatch-Core Rust crates and the twcore binary for an AI API gateway Linux server · macOS · Windows
/og/github/enterprise.png ThinkWatch AI bastion host for secure AI API and MCP access Docker Compose · Kubernetes
/og/github/home.png .github (organization profile) AI gateways for organizations and individual developers ThinkWatch Enterprise · ThinkWatch Lite · ThinkWatch Core

The name and the labels are the site card's (cardText). The line follows each repository's description on GitHub instead of the page headline, which says less about a repository: the Core page headline, for example, does not say that the repository holds crates and a binary.

Verification

  • pnpm build (pnpm 10): the four site cards in dist/og/*.png are byte-identical to those built from main and to the ones served by thinkwat.ch.
  • dist/og/github/*.png: 1280×640 PNG, 91–97 KB each; sitemap-0.xml has no /og/ URL.
  • tsc --noEmit -p .: no errors.

Once this is deployed, each image is uploaded by hand to its repository from https://thinkwat.ch/og/github/<card>.png.

🤖 Generated with Claude Code

GitHub has no API for a repository's social preview, so the image is
uploaded by hand. Build it with the site's share cards rather than by
hand elsewhere: the same card at the 1280x640 GitHub recommends, one
each for ThinkWatch-Lite, ThinkWatch-Core, ThinkWatch and the
organization's .github profile, published at /og/github/<card>.png.
The name and the labels are the site card's; the line under the name
follows each repository's description on GitHub.

The site's own cards come out byte for byte the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

1 participant